Something went wrong. Try again.
a fork of EvalEx by ezylang with a handful of breaking changes
Something went wrong. Try again.
12345678910111213141516171819202122232425262728from abc import ABC, abstractmethod
import httpx
from cross.service import Servicefrom database.connection import DatabasePool
class MisskeyService(ABC, Service): def __init__(self, url: str, db: DatabasePool, http: httpx.Client) -> None: super().__init__(url, db) self.http = http
def verify_credentials(self): response = self.http.post( f"{self.url}/api/i", json={"i": self._get_token()}, headers={"Content-Type": "application/json"}, ) if response.status_code != 200: self.log.error("Failed to validate user credentials!") response.raise_for_status() return dict(response.json())
@abstractmethod def _get_token(self) -> str: pass