[mastodon] Load database references

pull/2/head
missytake 2022-03-03 20:09:34 +01:00
parent 37f7b98c67
commit 12935b79cb
1 changed files with 4 additions and 3 deletions

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