Currently commands are done using a Consumer, which ends up returning nothing and taking a ChatInterface. This makes implementing replies and substituting commands a little... incoherent.
To "prevent" this from happening we should remove the connection Command -> ChatInterface, by having commands return their message output as a String instead of directly sending it. This also may allow us to just pass a String to the commands instead of the whole ChatMessage, but this may be unsuitable for commands requiring certain permissions
This would give the DefaultBot another responsibility, namely using the commands' "response" to create a message from them, that can be sent using the ChatInterface. In turn this would couple the bot with the ChatInterface, and that's not a nice way to do things... it might be interesting to extract the whole command processing to a separate class and have the bot act as a proxy / filter of sorts for the mindjail. I'd like to solicit discussion on a properly decoupled design for this before any implementation is carried out
Currently commands are done using a Consumer, which ends up returning nothing and taking a ChatInterface. This makes implementing replies and substituting commands a little... incoherent.
To "prevent" this from happening we should remove the connection Command -> ChatInterface, by having commands return their message output as a String instead of directly sending it. This also may allow us to just pass a String to the commands instead of the whole ChatMessage, but this may be unsuitable for commands requiring certain permissions
This would give the DefaultBot another responsibility, namely using the commands' "response" to create a message from them, that can be sent using the ChatInterface. In turn this would couple the bot with the ChatInterface, and that's not a nice way to do things... it might be interesting to extract the whole command processing to a separate class and have the bot act as a proxy / filter of sorts for the mindjail. I'd like to solicit discussion on a properly decoupled design for this before any implementation is carried out