Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Simulate discord typing while generating a response #1712

Merged
merged 4 commits into from
Jan 4, 2025

Conversation

dxlliv
Copy link
Contributor

@dxlliv dxlliv commented Jan 3, 2025

Relates to: Discord Client

Risks

Low: Probably none

Background

What does this PR do?

It implements sendTyping() from Discord.js to indicate bot activity while generating a response.

What kind of change is this?

Features (non-breaking change which adds functionality)

Why are we doing this? Any context or related work?

Without a typing indicator, users might feel unsure if the bot is working, especially during longer response generation times. The indicator simulates how humans communicate in real-time, making the bot feel more natural and engaging.

Documentation changes needed?

My changes do not require a change to the project documentation.

Testing

Where should a reviewer start?

Test in Discord by tagging the bot and observing if the typing indicator appears during response generation.

Discord username

@dxlliv

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dxlliv! Welcome to the ai16z community. Thanks for submitting your first pull request; your efforts are helping us accelerate towards AGI. We'll review it shortly. You are now a ai16z contributor!

@azep-ninja
Copy link
Contributor

azep-ninja commented Jan 3, 2025

This is a great add on!

Love it. Great way to simulate more "humanization"!

Looks like you could do something similar with TG which would be a great add as well if your up for it!

Example of telegam usage:

bot.on('text', async (ctx) => {
  // Simulate typing for 2 seconds
  await ctx.sendChatAction('typing');
  await new Promise(resolve => setTimeout(resolve, 2000));

  // Send the actual message
  ctx.reply('Hello!');
});

@dxlliv dxlliv changed the base branch from main to develop January 3, 2025 20:34
@shakkernerd shakkernerd changed the title Simulate discord typing while generating a response feat: Simulate discord typing while generating a response Jan 4, 2025
@shakkernerd shakkernerd merged commit 60db2b7 into elizaOS:develop Jan 4, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants