{"action":"created","issue":{"url":"https://api.github.com/repos/archangelic/pinhook/issues/31","repository_url":"https://api.github.com/repos/archangelic/pinhook","labels_url":"https://api.github.com/repos/archangelic/pinhook/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/archangelic/pinhook/issues/31/comments","events_url":"https://api.github.com/repos/archangelic/pinhook/issues/31/events","html_url":"https://github.com/archangelic/pinhook/issues/31","id":367511442,"node_id":"MDU6SXNzdWUzNjc1MTE0NDI=","number":31,"title":"Abstraction for multiple backends","user":{"login":"Lucidiot","id":15960782,"node_id":"MDQ6VXNlcjE1OTYwNzgy","avatar_url":"https://avatars2.githubusercontent.com/u/15960782?v=4","gravatar_id":"","url":"https://api.github.com/users/Lucidiot","html_url":"https://github.com/Lucidiot","followers_url":"https://api.github.com/users/Lucidiot/followers","following_url":"https://api.github.com/users/Lucidiot/following{/other_user}","gists_url":"https://api.github.com/users/Lucidiot/gists{/gist_id}","starred_url":"https://api.github.com/users/Lucidiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lucidiot/subscriptions","organizations_url":"https://api.github.com/users/Lucidiot/orgs","repos_url":"https://api.github.com/users/Lucidiot/repos","events_url":"https://api.github.com/users/Lucidiot/events{/privacy}","received_events_url":"https://api.github.com/users/Lucidiot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-07T01:32:57Z","updated_at":"2018-10-07T05:01:08Z","closed_at":null,"author_association":"NONE","body":"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.\r\n\r\nThe 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.\r\n\r\nIt could be possible to use [Abstract Base Classes](https://docs.python.org/3.7/library/abc.html) to enforce implementing specific methods if needed.\r\n\r\nMessages 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)."},"comment":{"url":"https://api.github.com/repos/archangelic/pinhook/issues/comments/427626158","html_url":"https://github.com/archangelic/pinhook/issues/31#issuecomment-427626158","issue_url":"https://api.github.com/repos/archangelic/pinhook/issues/31","id":427626158,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzYyNjE1OA==","user":{"login":"archangelic","id":776091,"node_id":"MDQ6VXNlcjc3NjA5MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/776091?v=4","gravatar_id":"","url":"https://api.github.com/users/archangelic","html_url":"https://github.com/archangelic","followers_url":"https://api.github.com/users/archangelic/followers","following_url":"https://api.github.com/users/archangelic/following{/other_user}","gists_url":"https://api.github.com/users/archangelic/gists{/gist_id}","starred_url":"https://api.github.com/users/archangelic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/archangelic/subscriptions","organizations_url":"https://api.github.com/users/archangelic/orgs","repos_url":"https://api.github.com/users/archangelic/repos","events_url":"https://api.github.com/users/archangelic/events{/privacy}","received_events_url":"https://api.github.com/users/archangelic/received_events","type":"User","site_admin":false},"created_at":"2018-10-07T05:01:08Z","updated_at":"2018-10-07T05:01:08Z","author_association":"OWNER","body":"Definitely gonna brainstorm about this. This is really good. "}}
{"actor":{"display_login":"archangelic"}}