【发布时间】:2018-06-09 08:23:54
【问题描述】:
我有一个电报机器人,我正在尝试通过添加更多CommandHandler 来添加一些我觉得有用的“功能”。新功能在个人聊天中运行良好,但在群聊中不起作用。我对此感到困惑。
我的代码如下
def func1(bot, update):
<somecode>
def func2(bot, update, args):
<somecode>
def error(bot, update, error):
<errorhandler>
def newfunc(bot, update, args):
<newcode>
dispatcher.add_handler(CommandHandler('func1', func1))
dispatcher.add_handler(CommandHandler('func2', func2, pass_args=True))
dispatcher.add_handler(CommandHandler('newfunc', newfunc, pass_args=True))
dispatcher.add_error_handler(error)
func1 和 func2 工作正常,它们以前在那里,但新的 newfunc 在群聊中不起作用。
不知道是什么原因造成的
【问题讨论】:
-
错误是什么?
-
没有。在群聊的情况下,请求不会到达服务器。它适用于个人聊天
标签: python telegram telegram-bot python-telegram-bot telegram-webhook