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

Fix bug causing bot to reply to its own messages in event_handler example #251

Merged
merged 1 commit into from
Mar 17, 2024
Merged

Fix bug causing bot to reply to its own messages in event_handler example #251

merged 1 commit into from
Mar 17, 2024

Conversation

Spacerulerwill
Copy link
Contributor

In the event_handler example, sending message containing the word "poise" would cause the bot to reply with the message "Poise has been mentioned {n} times" like expected. However, since the bot's message itself contained the word "poise", it would continually reply to itself.

I fixed it by adding a simple check to test the message_author's id against the bot's user id.

@kangalio
Copy link
Collaborator

Thank you! The CI is still failing, but then we can merge

@Spacerulerwill
Copy link
Contributor Author

I have formatted the file properly with rustfmt and have ammended my commit

@kangalio kangalio merged commit 48b0318 into serenity-rs:current Mar 17, 2024
12 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.

2 participants