Added a function to make bot send a message when mentioned - #15
Open
pistonpro0001 wants to merge 3 commits into
Open
Added a function to make bot send a message when mentioned#15pistonpro0001 wants to merge 3 commits into
pistonpro0001 wants to merge 3 commits into
Conversation
Used the `bot.event` decorator to allow bot to respond to replies and mentions, only when it isn't the bot itself. Also removed unneeded function `get_or_create...` because the game I made to test isn't implemented anymore. Closes: #14
roli2py
requested changes
Aug 15, 2026
| @bot.event | ||
| async def on_message(message): | ||
| if message.author == bot.user: | ||
| return |
Collaborator
There was a problem hiding this comment.
By PEP 8, it's a bad practice to do the implicit return of None, but, for now, we don't have an established style guidelines, so I'll keep the decision to the author.
Our main goal is to establish the style guidelines and then we can continue to make new changes and review PRs.
Repository owner
deleted a comment from
pistonpro0001
Aug 15, 2026
Co-authored-by: Roman <romanmashevskyi@proton.me>
roli2py suggested that I comment how the parts of the bot reply function work, so I added comments in the `on_message` function to clarify what each part of the function does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Used the
bot.eventdecorator to allow bot to respond to replies and mentions, only when it isn't the bot itself. Also removed unneeded functionget_or_create...because the game I made to test isn't implemented anymore.Closes: #14