Refactor new models import
This commit is contained in:
@@ -25,6 +25,10 @@ from flanabot.models import Chat, Message, Punishment, WeatherChart
|
||||
# --------------------------------------------- FLANA_BOT --------------------------------------------- #
|
||||
# ----------------------------------------------------------------------------------------------------- #
|
||||
class FlanaBot(MultiBot, ABC):
|
||||
Chat = Chat
|
||||
Message = Message
|
||||
User = User
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.lock = asyncio.Lock()
|
||||
@@ -774,10 +778,6 @@ class FlanaBot(MultiBot, ABC):
|
||||
# -------------------------------------------------------- #
|
||||
# -------------------- PUBLIC METHODS -------------------- #
|
||||
# -------------------------------------------------------- #
|
||||
@property
|
||||
def chat_class(self) -> Type[Chat]:
|
||||
return Chat
|
||||
|
||||
async def check_old_punishments(self):
|
||||
punishments = Punishment.find({'platform': self.platform.value}, lazy=True)
|
||||
|
||||
@@ -803,10 +803,6 @@ class FlanaBot(MultiBot, ABC):
|
||||
async def is_punished(self, user: int | str | User, group_: int | str | Chat | Message) -> bool:
|
||||
pass
|
||||
|
||||
@property
|
||||
def message_class(self) -> Type[Message]:
|
||||
return Message
|
||||
|
||||
async def punish(
|
||||
self,
|
||||
user: int | str | User,
|
||||
|
||||
Reference in New Issue
Block a user