Summary
Right now the bot responds to any command followed by /. This may create conflicts if there are multiple bots in the group and a
given command is not meant for this bot.
So the bot should respond only when it is addressed. E.g: /command@bot_name
Alternatives
Do suggest in the comments if you have some other approach in mind. :smiley:
If this is your first time contributing
Hey! :wave: If you're interested to work on this issue, do comment, "I would like to work on this issue. Please assign this to me.", below to let others know that you're interested in working on this. Also, do take a look at the contributing guide which will take you step by step from forking this repo to creating a pull request :rocket: :fire:.
We use the python-telegram-bot api wrapper. Here is a link to its documentation: https://python-telegram-bot.readthedocs.io/en/stable/index.html
Feel free to ask anything related to this issue :hugs:
Summary Right now the bot responds to any command followed by
/
. This may create conflicts if there are multiple bots in the group and a given command is not meant for this bot. So the bot should respond only when it is addressed. E.g:/command@bot_name
Implementation A possible way to implement this is using regular expressions. We can add regex filters in
CommandHandler
s. https://github.com/JIITODC/bot/blob/22302be3e738a49ec22da6be882a50f16376a292/bot.py#L54 Here is a brief documentation on the regex filter that thepython-telegram-bot
api wrapper provides: https://python-telegram-bot.readthedocs.io/en/stable/telegram.ext.filters.html#telegram.ext.filters.Filters.regexLastly, a little guide on regular expressions: https://medium.com/factory-mind/regex-tutorial-a-simple-cheatsheet-by-examples-649dc1c3f285
Alternatives Do suggest in the comments if you have some other approach in mind. :smiley:
If this is your first time contributing Hey! :wave: If you're interested to work on this issue, do comment, "I would like to work on this issue. Please assign this to me.", below to let others know that you're interested in working on this. Also, do take a look at the contributing guide which will take you step by step from forking this repo to creating a pull request :rocket: :fire:. We use the
python-telegram-bot
api wrapper. Here is a link to its documentation: https://python-telegram-bot.readthedocs.io/en/stable/index.html Feel free to ask anything related to this issue :hugs: