diff --git a/u232ping/abc/db.py b/u232ping/abc/db.py new file mode 100644 index 0000000..942c59a --- /dev/null +++ b/u232ping/abc/db.py @@ -0,0 +1,13 @@ +from abc import ABC, abstractmethod +from u232ping.types import Group + +class DataBase(ABC): + + @abstractmethod + async def get_group(self, group_idx: int) -> Group: + raise NotImplementedError + + + @abstractmethod + async def get_all(self) -> Group: + raise NotImplementedError diff --git a/u232ping/types.py b/u232ping/types.py new file mode 100644 index 0000000..59b207d --- /dev/null +++ b/u232ping/types.py @@ -0,0 +1,12 @@ +from typing import Iterable + +class Group(object): + + members: Iterable + + def __init__(self, members: Iterable) -> None: + self.members = members + + def __str__(self) -> str: + lst = tuple(map(lambda member: f"@{member}", self.members)) + return "/n".join(lst)