[mastodon] Load database references

This commit is contained in:
missytake 2022-03-03 20:09:34 +01:00
parent 2f32d949b4
commit d32ccc52ec

View file

@ -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):