Does this mean it isn't currently possible to do something like this:
/msg *module command
because it isn't possible to call AddCommand in a Python module?
Does this mean it isn't currently possible to do something like this:
`/msg *module command`
because it isn't possible to call AddCommand in a Python module?
<!-- github-comment-id:474331096 -->
OnModCommand() is still available, but you need to parse the line yourself.
вт, 19 мар. 2019 г. в 11:53, Philip Colmer <notifications@github.com>:
> Does this mean it isn't currently possible to do something like this:
>
> /msg *module command
>
> because it isn't possible to call AddCommand in a Python module?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/znc/znc/issues/198#issuecomment-474331096>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAT15MtrkWYJoaQkAq8_0DBW9RNdjFmOks5vYM-0gaJpZM4AFEbH>
> .
>
<!-- github-comment-id:474361712 -->
@DarthGandalf thanks. If I add OnModCommand and send a private message to my module, I get:
This module doesn't implement any commands.
which seems to suggest that I still need to call AddCommand somehow, but I'm struggling with the parameters to give it. The call is insisting that I pass it a CModCOmmand::ModCmdFunc.
What am I misunderstanding here?
@DarthGandalf thanks. If I add OnModCommand and send a private message to my module, I get:
`This module doesn't implement any commands.`
which seems to suggest that I still need to call AddCommand somehow, but I'm struggling with the parameters to give it. The call is insisting that I pass it a CModCOmmand::ModCmdFunc.
What am I misunderstanding here?
<!-- github-comment-id:474379678 -->
which seems to suggest that I still need to call AddCommand somehow, but
I'm struggling with the parameters to give it. The call is insisting that I
pass it a CModCOmmand::ModCmdFunc.
You don't just add it. You need to implement it. The default implementation
uses commands which were added via AddCommand().
CModCommand::ModCmdFunc is exactly why AddCommand doesn't work currently,
this is what this issue is about - to make AddCommand work.
вт, 19 мар. 2019 г. в 13:52, Philip Colmer <notifications@github.com>:
> @DarthGandalf <https://github.com/DarthGandalf> thanks. If I add
> OnModCommand and send a private message to my module, I get:
>
> This module doesn't implement any commands.
>
> which seems to suggest that I still need to call AddCommand somehow, but
> I'm struggling with the parameters to give it. The call is insisting that I
> pass it a CModCOmmand::ModCmdFunc.
>
> What am I misunderstanding here?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/znc/znc/issues/198#issuecomment-474379678>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAT15BUsPQEWZ1fuLlXArM5wKRW6USfDks5vYOuqgaJpZM4AFEbH>
> .
>
<!-- github-comment-id:474391503 -->
If AddCommand doesn't work then how do I implement OnModCommand? The code for the pyeval module just adds the function and has code to do processing when the function is called. I've added a definition for OnModCommand but it doesn't get called - I just get that error message displayed.
I'm sorry - I don't understand.
If AddCommand doesn't work then how do I implement OnModCommand? The code for the `pyeval` module just adds the function and has code to do processing when the function is called. I've added a definition for OnModCommand but it doesn't get called - I just get that error message displayed.
```
def OnModCommand(self, message):
print("OnModCommand")
```
<!-- github-comment-id:474399856 -->
Hmm … I've just realised that my OnModCommandis getting called as the print statement is being executed.
So what do I need to do to tell ZNC that the call has been handled? It is a void function and this is partly why I'm confused about this.
Hmm … I've just realised that my `OnModCommand` **is** getting called as the `print` statement is being executed.
So what do I need to do to tell ZNC that the call has been handled? It is a `void` function and this is partly why I'm confused about this.
<!-- github-comment-id:474409926 -->
OK … if I call something like PutModule, I stop getting the error message about there not being any commands implementation. I think I'm OK with this now.
OK … if I call something like PutModule, I stop getting the error message about there not being any commands implementation. I think I'm OK with this now.
<!-- github-comment-id:474411935 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I encountered the same issue....
Why don't you circumvent the issue by implementing an independent command system in python?
That would be a possible solution, yes.
As for why, because noone implenented it?
Does this mean it isn't currently possible to do something like this:
/msg *module commandbecause it isn't possible to call AddCommand in a Python module?
OnModCommand() is still available, but you need to parse the line yourself.
вт, 19 мар. 2019 г. в 11:53, Philip Colmer notifications@github.com:
@DarthGandalf thanks. If I add OnModCommand and send a private message to my module, I get:
This module doesn't implement any commands.which seems to suggest that I still need to call AddCommand somehow, but I'm struggling with the parameters to give it. The call is insisting that I pass it a CModCOmmand::ModCmdFunc.
What am I misunderstanding here?
You don't just add it. You need to implement it. The default implementation
uses commands which were added via AddCommand().
CModCommand::ModCmdFunc is exactly why AddCommand doesn't work currently,
this is what this issue is about - to make AddCommand work.
вт, 19 мар. 2019 г. в 13:52, Philip Colmer notifications@github.com:
I'm sorry - I don't understand.
If AddCommand doesn't work then how do I implement OnModCommand? The code for the
pyevalmodule just adds the function and has code to do processing when the function is called. I've added a definition for OnModCommand but it doesn't get called - I just get that error message displayed.Hmm … I've just realised that my
OnModCommandis getting called as theprintstatement is being executed.So what do I need to do to tell ZNC that the call has been handled? It is a
voidfunction and this is partly why I'm confused about this.OK … if I call something like PutModule, I stop getting the error message about there not being any commands implementation. I think I'm OK with this now.