Closed Braastos closed 1 year ago
this would be reasonably easy to implement but I am still not sure if this is something that should be handled by the library. Adding logic ala "is this command supposed to be used in this channel" is much more flexible in the user code outside the library.
Maybe a flexible way to add this to the library would be to allow command middleware where people can insert their own command execution logic.
This implementation allows multiple Rooms to listen to. It would be useful if commands could be defined on a optional per Room Basis.
So something like this could be possible:
chat.register_command('reply', test_command, room="SomeChannelName") #register only for SomeChannelName chat.register_command('reply2', test_command2) #register for all channels