Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstraction for multiple backends #31

Open
Lucidiot opened this issue Oct 7, 2018 · 4 comments
Open

Abstraction for multiple backends #31

Lucidiot opened this issue Oct 7, 2018 · 4 comments
Labels
backend Add support for multiple backends core issues related to core pinhook functionality such as plugin reloading, internal commands enhancement additional features

Comments

@Lucidiot
Copy link
Contributor

Lucidiot commented Oct 7, 2018

Instead of having IRCBot and TwitchBot classes, have a single Bot class that takes a backend as a parameter. That could allow to split pinhook into multiple packages, like pinhook-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 and message) to provide support for backends from different paradigms (like toots or facebook privacy settings).

@archangelic
Copy link
Owner

Definitely gonna brainstorm about this. This is really good.

@archangelic archangelic added enhancement additional features future Things on the roadmap labels Oct 7, 2018
@archangelic archangelic added Pinhook v2 future Things on the roadmap and removed future Things on the roadmap Pinhook v2 labels Oct 10, 2018
@archangelic archangelic added the core issues related to core pinhook functionality such as plugin reloading, internal commands label Jan 25, 2019
@archangelic archangelic added pinhook v2 and removed future Things on the roadmap labels Jan 29, 2019
@ixxie
Copy link
Contributor

ixxie commented Feb 23, 2019

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.

@ixxie
Copy link
Contributor

ixxie commented Mar 4, 2019

This would also solve the problem of not being able to connect to multiple networks at once.

@archangelic
Copy link
Owner

@ixxie Opened #64 to discuss this further.

@archangelic archangelic added backend Add support for multiple backends and removed pinhook v2 labels Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Add support for multiple backends core issues related to core pinhook functionality such as plugin reloading, internal commands enhancement additional features
Projects
Status: Backends
Development

No branches or pull requests

3 participants