Skip to content

Added a function to make bot send a message when mentioned - #15

Open
pistonpro0001 wants to merge 3 commits into
masterfrom
bot-reply
Open

Added a function to make bot send a message when mentioned#15
pistonpro0001 wants to merge 3 commits into
masterfrom
bot-reply

Conversation

@pistonpro0001

Copy link
Copy Markdown
Owner

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

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
@pistonpro0001
pistonpro0001 requested a review from roli2py August 14, 2026 23:36
@pistonpro0001 pistonpro0001 added the enhancement New feature or request label Aug 14, 2026

@roli2py roli2py left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, I can't understand a purpose of this functionality, because, for now, it replies with a static text. For now, it seems as an overwhelm.

Comment thread main.py Outdated
Comment thread main.py
@bot.event
async def on_message(message):
if message.author == bot.user:
return

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Good to know!

Repository owner deleted a comment from pistonpro0001 Aug 15, 2026
pistonpro0001 and others added 2 commits August 15, 2026 15:31
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Bot respond to replies and mentions from user

2 participants