diff --git a/modules/modpython/znc.py b/modules/modpython/znc.py index 26b98590..5de9f705 100644 --- a/modules/modpython/znc.py +++ b/modules/modpython/znc.py @@ -434,9 +434,9 @@ class Module: # Command stuff def AddCommand(self, cls, *args, **kwargs): cmd = cls(*args, **kwargs) - cmd._cmodcommand = CreatePyModCommand(self._cmod, cls.cmd, + cmd._cmodcommand = CreatePyModCommand(self._cmod, cls.command, COptionalTranslation(cls.args), - COptionalTranslation(cls.desc), + COptionalTranslation(cls.description), cmd) return cmd @@ -685,9 +685,9 @@ class Module: class Command: - cmd = '' + command = '' args = '' - desc = '' + description = '' def __call__(self, sLine): pass diff --git a/test/integration/tests/scripting.cpp b/test/integration/tests/scripting.cpp index 3fcd707f..7ee61821 100644 --- a/test/integration/tests/scripting.cpp +++ b/test/integration/tests/scripting.cpp @@ -310,11 +310,13 @@ TEST_F(ZNCTest, ModpythonCommand) { class cmdtest(znc.Module): def OnLoad(self, args, message): + self.AddHelpCommand() self.AddCommand(testcmd) return True class testcmd(znc.Command): - cmd = 'ping' + command = 'ping' + description = cmdtest.t_d('blah') def __call__(self, line): self.GetModule().PutModule('pong') @@ -324,8 +326,9 @@ TEST_F(ZNCTest, ModpythonCommand) { auto client = LoginClient(); client.Write("znc loadmod modpython"); client.Write("znc loadmod cmdtest"); + client.Write("PRIVMSG *cmdtest :help"); client.Write("PRIVMSG *cmdtest :ping"); - client.ReadUntil("pong"); + client.ReadUntil(":*cmdtest!znc@znc.in PRIVMSG nick :pong"); } } // namespace