parent
1b6f0ff660
commit
3b7c9cacc7
|
@ -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
|
|
@ -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)
|
Loading…
Reference in New Issue