我在匹配单个单词时遇到问题。我正在制作一个松散的僵尸程序,但我在使用正则表达式时遇到了一些困难,这里的代码是破坏我的程序的:
@listen_to(r'(?:\W|^)(CTRG|Viper)(?:\W|$)', re.IGNORECASE)
def refme_send(message):
sleep(1)
answers = ('You\'re not supposed to talk about it.', 'This information is classified!')
message.send(answers[randrange(0, len(answers))])
这是我在测试时得到的错误:
Traceback (most recent call last):
File "/home/my_user/.slack/SlackBot/lib/python3.5/site-packages/slackbot/dispatcher.py", line 55, in _dispatch_msg_handler
func(Message(self._client, msg), *args)
TypeError: hello_reply() takes 1 positional argument but 2 were given
感谢您的帮助。