Open Lucidiot opened 6 years ago
Definitely gonna brainstorm about this. This is really good.
This is a great idea but I wonder if splitting the package afterwards is wise; there are interesting use-cases for the same bot simultaneously plugging into multiple back-ends, and this may be trickier to achieve when the packaging is split.
This would also solve the problem of not being able to connect to multiple networks at once.
@ixxie Opened #64 to discuss this further.
Instead of having
IRCBot
andTwitchBot
classes, have a singleBot
class that takes a backend as a parameter. That could allow to split pinhook into multiple packages, likepinhook-irc
,pinhook-twitch
, etc.The backend could be a class or a string pointing to a class (to help with import troubles). A backend would be initialized with the Bot instance as a parameter, and started as soon as the bot is ready to accept events; then, the backend deals with everything and fires
on_*
events on the bot.It could be possible to use Abstract Base Classes to enforce implementing specific methods if needed.
Messages would probably need to become even more abstract (or have more possibilities than just
action
andmessage
) to provide support for backends from different paradigms (like toots or facebook privacy settings).