[WIP] Added auto roles list #134

This commit is contained in:
2023-02-19 17:32:08 +01:00
parent 8f95e196ec
commit e0ca057399
22 changed files with 669 additions and 37 deletions

View File

@@ -45,16 +45,19 @@ class AutoRoleFilter(FilterABC):
query = query.where(lambda x: x.id == self._id)
if self._channel_id is not None:
query = query.where(lambda x: x.discord_channel_id == self._channel_id)
if self._channel_name is not None and self._channel_id is not None:
query = query.where(
lambda x: self._bot.get_channel(x.discord_channel_id).name == self._channel_name
or self._channel_name in self._bot.get_channel(x.discord_channel_id).name
lambda x: x.discord_channel_id == self._channel_id or str(self._channel_id) in str(x.discord_channel_id)
)
if self._channel_name is not None:
query = query.where(
lambda x: x.discord_channel_name == self._channel_name or self._channel_name in x.discord_channel_name
)
if self._message_id is not None:
query = query.where(lambda x: x.discord_message_id == self._message_id)
query = query.where(
lambda x: x.discord_message_id == self._message_id or str(self._message_id) in str(x.discord_message_id)
)
if self._server is not None:
servers = self._server.filter(query.select(lambda x: x.server)).select(lambda x: x.id)