2022-12-22 14:18:43 +00:00
|
|
|
from mipa.ext import commands
|
|
|
|
from mipa.router import Router
|
|
|
|
from mipac import Note
|
|
|
|
|
|
|
|
from defs.misskey import send_update
|
|
|
|
from glover import admin
|
|
|
|
|
|
|
|
|
|
|
|
class MisskeyBot(commands.Bot):
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
|
|
|
|
async def on_ready(self, ws):
|
2022-12-23 03:06:17 +00:00
|
|
|
await Router(ws).connect_channel(["main", "home"])
|
2022-12-22 14:18:43 +00:00
|
|
|
|
2022-12-24 04:09:40 +00:00
|
|
|
async def on_reconnect(self, ws):
|
|
|
|
await Router(ws).connect_channel(["main", "home"])
|
|
|
|
|
2022-12-24 13:19:24 +00:00
|
|
|
async def on_note(self, note: Note):
|
2022-12-22 14:18:43 +00:00
|
|
|
await send_update(admin, note)
|
|
|
|
|
|
|
|
|
|
|
|
misskey_bot = MisskeyBot()
|