Title: Bot is responding to commands for other bots in group chats when privacy option is turned off · Issue #319 · python-telegram-bot/python-telegram-bot · GitHub
Open Graph Title: Bot is responding to commands for other bots in group chats when privacy option is turned off · Issue #319 · python-telegram-bot/python-telegram-bot
X Title: Bot is responding to commands for other bots in group chats when privacy option is turned off · Issue #319 · python-telegram-bot/python-telegram-bot
Description: Steps to reproduce Get a bot, turn off privacy option in @botfather, and drag it in a group with other bots (which should respond to /start command in a group). Set up the bot with the following code: import telegram, telegram.ext tb = t...
Open Graph Description: Steps to reproduce Get a bot, turn off privacy option in @botfather, and drag it in a group with other bots (which should respond to /start command in a group). Set up the bot with the following co...
X Description: Steps to reproduce Get a bot, turn off privacy option in @botfather, and drag it in a group with other bots (which should respond to /start command in a group). Set up the bot with the following co...
Opengraph URL: https://github.com/python-telegram-bot/python-telegram-bot/issues/319
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bot is responding to commands for other bots in group chats when privacy option is turned off","articleBody":"\u003c!--\nThanks for reporting issues of python-telegram-bot!\nTo make it easier for us to help you please enter detailed information below.\n--\u003e\n### Steps to reproduce\n1. Get a bot, turn off privacy option in `@botfather`, and drag it in a group with other bots (which should respond to `/start` command in a group).\n2. Set up the bot with the following code:\n\n``` python\nimport telegram, telegram.ext\ntb = telegram.ext.Updater(\"TOKEN\")\ndef a(bot, update):\n bot.sendMessage(update.message.chat_id, \"responding to /start cmd\")\n\ntb.dispatcher.add_handler(telegram.ext.CommandHandler(\"start\", b))\ntb.start_polling()\n```\n1. Send command `/start@some_other_bot` to the group, and your bot will respond to it.\n2. Send command `/start` to the group and your bot (and in fact many other bots) will respond to it too.\n### Expected behaviour\n\nBot should not respond to cmds not pointing to it, and better give an option not to respond to cmd with no target in a group.\n### Configuration\n\n**Operating System:**\nMac OS X El Capitan\n\n**Version of Python:**\n\n`$ python3 -V`\n\n`Python 3.5.1`\n\n**Version of python-telegram-bot:**\n\n`$ python3 -c 'import telegram; print(telegram.__version__)'`\n\n`4.1.1`\n### Logs\n\nInsert logs here (if necessary)\n### Where the issue happens\n\n``` python\nupdate.message.text[1:].split(' ')[0].split('@')[0] == self.command\n```\n\non line 45 of `telegram/ext/commandhandler.py`\nIt is not checking for the target of command issued by user.\n### Suggested changes\n1. [ ] Check for commands with `@` for whether it's pointed to the bot.\n2. [ ] Add a parameter to `CommandHandler`: toggle whether if the bot should respond to simple commands (command without `@name_of_the_bot`) in a group, and default it to True. (for backward compatibility, and behaviour consistancy)\n","author":{"url":"https://github.com/blueset","@type":"Person","name":"blueset"},"datePublished":"2016-06-01T10:35:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/319/python-telegram-bot/issues/319"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:286ec867-5dec-3916-852c-e527d0e1ecb5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E8F0:257F3:1B736CE:242E954:6A5C84CA |
| html-safe-nonce | fb3931cdf9faee2b81644f0b1fda6ea1959cf9b87d0df8eea579e87ad148690a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEYwOjI1N0YzOjFCNzM2Q0U6MjQyRTk1NDo2QTVDODRDQSIsInZpc2l0b3JfaWQiOiI1NDA5ODEzOTEzMDE3Mjg3ODgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ed39288bdd20cdf9894dbbcd00641cc17b2887f2a29287348d7a107095764f61 |
| hovercard-subject-tag | issue:157875076 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-telegram-bot/python-telegram-bot/319/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8156054ef40c0a6284ffb96d79a63d609abdcf205381be71e21d3a3919b5d38c/python-telegram-bot/python-telegram-bot/issues/319 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8156054ef40c0a6284ffb96d79a63d609abdcf205381be71e21d3a3919b5d38c/python-telegram-bot/python-telegram-bot/issues/319 |
| og:image:alt | Steps to reproduce Get a bot, turn off privacy option in @botfather, and drag it in a group with other bots (which should respond to /start command in a group). Set up the bot with the following co... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | blueset |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/python-telegram-bot/python-telegram-bot git https://github.com/python-telegram-bot/python-telegram-bot.git |
| octolytics-dimension-user_id | 16178365 |
| octolytics-dimension-user_login | python-telegram-bot |
| octolytics-dimension-repository_id | 38696925 |
| octolytics-dimension-repository_nwo | python-telegram-bot/python-telegram-bot |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38696925 |
| octolytics-dimension-repository_network_root_nwo | python-telegram-bot/python-telegram-bot |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width