0

我正在尝试使用 supybot 插件,但我不断收到错误并且无法修复(我使用 Python 2.6)

这是我得到的错误:

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/supybot/callbacks.py", line 1180, in _callCommand
    self.callCommand(command, irc, msg, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/supybot/utils/python.py", line 86, in g
    f(self, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/supybot/callbacks.py", line 1166, in callCommand
    method(irc, msg, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/supybot/commands.py", line 913, in newf
    f(self, irc, msg, args, *state.args, **state.kwargs)
  File "/usr/lib/python2.6/site-packages/supybot/plugins/Slap1/plugin.py", line 109, in slap
    self.me(irc, text)
TypeError: me() takes exactly 2 arguments (3 given)
ERROR 2013-03-19T15:13:13 supybot Exception id: 0x873c0

插件代码可以在这里找到:

https://raw.github.com/StevenRKM/supybot-plugins/master/Slap/plugin.py

请帮我解决这个问题

4

2 回答 2

4

您的me方法具有以下签名:def me(self, msg). 它被称为self.me(irc, text)需要签名为def me(self, irc, msg).

于 2013-03-19T12:23:17.360 回答
2

我认为该消息提供了一个非常有力的线索,说明出了什么问题。

me()使用三个参数 ( self,irctext) 调用,而它需要两个 (selfmsg)。

于 2013-03-19T12:23:37.613 回答