1
0
Fork 0
forked from waifu/kemoverse

begin restructuring bot's fediverse client code

This commit is contained in:
pwm 2025-06-07 17:07:06 -04:00
parent 2d7107e745
commit b1b3f62d37

View file

@ -1,6 +1,45 @@
from abc import abstractmethod
from typing import Iterable, override
import misskey
import config
class FediverseNote:
"""Abstraction for notes Use this to talk to per-software implementations"""
def __init__(self, note):
pass
def client_connection() -> misskey.Misskey:
return misskey.Misskey(address=config.INSTANCE, i=config.KEY)
class FediverseClient:
def __init__(self, instance, software):
self.instance = instance
self.software = software
@abstractmethod
def get_notifications(self) -> Iterable[FediverseNote]:
"""Page through notifications from the instance"""
pass
@abstractmethod
def create_note(self, text, visibility, addressee, attachment):
"""Create a new note"""
pass
class MisskeyClient(FediverseClient):
def __init__(self, instance, software):
super().__init__(instance, software)
def get_notifications(self) -> Iterable[FediverseNote]:
pass
def create_note(self, text, visibility, addressee, attachment):
pass
class PleromaClient(FediverseClient):
def __init__(self, instance, software):
super().__init__(instance, software)
def get_notifications(self) -> Iterable[FediverseNote]:
pass
def create_note(self, text, visibility, addressee, attachment):
pass