jbot
jbot copied to clipboard
External contorller for bot
Fixes #81. Added ability to register other beans as bot controller.
Some little fixes:
- Performance: pattern compiled only once
- Controllers methods check for compatibility on startup
Firstly, thanks a lot for contributing. I haven't thoroughly looked into your PR yet but after giving it a brief look I would like to know what you think of registering different classes via annotation?
Sorry for my english. :)
In the beginning, I thought that it was more correct to make a registration with a controller, since there might be several bots in the application. The code is ready for this.
Now I understand that it's not right to do several bots of the same class.
There remains a problem when it is not clear to which bot to bind the handler. I think it will be enough to make the @handler annotation in which the parameter will indicate the list of bot classes to which the handler can be bound. And if the list is empty, then the handler will be bound to all the bots.
I'll try to do it tonight.
This looks to be a great addition to the bot framework. Beyond the merge conflicts is there anything we can do to help this pull request along?
@Ravesty thanks for reaching out. I actually have thought to achieve this in a slightly different approach, so I have to edit this PR before merging. Moreover, I also need to update the documentation to make this PR ready.