我有一个电报机器人,我正在尝试向它添加一些我认为通过添加更多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
的在群聊中不起作用。
我不知道是什么原因造成的