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