Add Mastodon bot to Ticketfrei 3 #2
|
@ -8,7 +8,7 @@ from kibicara.platformapi import Censor, Spawner, Message
|
|||
from kibicara.platforms.mastodon.model import MastodonAccount
|
||||
|
||||
from mastodon import Mastodon, MastodonError
|
||||
from asyncio import gather
|
||||
from asyncio import gather, get_event_loop
|
||||
import sys
|
||||
|
||||
from logging import getLogger
|
||||
|
@ -21,13 +21,14 @@ class MastodonBot(Censor):
|
|||
super().__init__(mastodon_account_model.hood)
|
||||
self.model = mastodon_account_model
|
||||
self.enabled = self.model.enabled
|
||||
|
||||
async def run(self):
|
||||
await self.model.instance.load()
|
||||
self.account = Mastodon(
|
||||
client_id=self.model.instance.client_id,
|
||||
client_secret=self.model.instance.client_secret,
|
||||
access_token=self.model.access_token,
|
||||
)
|
||||
|
||||
async def run(self):
|
||||
await gather(self.poll(), self.push())
|
||||
|
||||
async def poll(self):
|
||||
|
|
Loading…
Reference in a new issue