You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# TODO: for the moment this is duplicated code from ModerationCogBase in a attempt to get the code out sooner
classPoll(commands.Cog):
def__init__(self, bot: Tux) ->None:
self.bot=botself.case_controller=CaseController()
# TODO: for the moment this is duplicated code from ModerationCogBase in a attempt to get the code out soonerasyncdefis_pollbanned(self, guild_id: int, user_id: int) ->bool:
""" Check if a user is poll banned. Parameters ---------- guild_id : int The ID of the guild to check in. user_id : int The ID of the user to check. Returns ------- bool True if the user is poll banned, False otherwise. """ban_cases=awaitself.case_controller.get_all_cases_by_type(guild_id, CaseType.POLLBAN)
unban_cases=awaitself.case_controller.get_all_cases_by_type(guild_id, CaseType.POLLUNBAN)
ban_count=sum(case.case_user_id==user_idforcaseinban_cases)
unban_count=sum(case.case_user_id==user_idforcaseinunban_cases)
return (
ban_count>unban_count
) # TODO: this implementation is flawed, if someone bans and unbans the same user multiple times, this will not work as expected@commands.Cog.listener() # listen for messagesasyncdefon_message(self, message: discord.Message) ->None:
The text was updated successfully, but these errors were encountered:
tux/tux/cogs/utility/poll.py
Line 19 in 9fbb1c7
The text was updated successfully, but these errors were encountered: