From c126cf8d47ed179de5c61e68c9d85ca1f9338dd2 Mon Sep 17 00:00:00 2001 From: lnguy Date: Mon, 11 Mar 2024 13:09:15 +0100 Subject: [PATCH] Remove ["FrameDataBot"] as test --- src/heihachi/bot.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/heihachi/bot.py b/src/heihachi/bot.py index 6c43d7c..273b312 100644 --- a/src/heihachi/bot.py +++ b/src/heihachi/bot.py @@ -75,7 +75,7 @@ def _is_user_blacklisted(self, user_id: str | int) -> bool: else: return False - def _is_author_newly_created(self, interaction: discord.Interaction["FrameDataBot"]) -> bool: + def _is_author_newly_created(self, interaction: discord.Interaction) -> bool: "Check if author of an interaction is newly created" today = datetime.datetime.strptime(datetime.datetime.now().isoformat(), "%Y-%m-%dT%H:%M:%S.%f") @@ -95,7 +95,7 @@ async def on_message(self, message: discord.Message) -> None: logger.debug(f"Message from {message.author.name} in {message.guild} is not a valid command") async def _character_name_autocomplete( - self, interaction: discord.Interaction["FrameDataBot"], current: str + self, interaction: discord.Interaction, current: str ) -> List[discord.app_commands.Choice[str]]: """ Autocomplete function for character names @@ -113,7 +113,7 @@ def _add_bot_commands(self) -> None: "Add all frame commands to the bot" @self.tree.command(name="fd", description="Frame data from a character move") @discord.app_commands.autocomplete(character=self._character_name_autocomplete) - async def _frame_data_cmd(interaction: discord.Interaction["FrameDataBot"], character: str, move: str) -> None: + async def _frame_data_cmd(interaction: discord.Interaction, character: str, move: str) -> None: logger.info(f"Received command from {interaction.user.name} in {interaction.guild}: /fd {character} {move}") character_name_query = character move_query = move @@ -124,7 +124,7 @@ async def _frame_data_cmd(interaction: discord.Interaction["FrameDataBot"], char if self.config.feedback_channel_id and self.config.action_channel_id: @self.tree.command(name="feedback", description="Send feedback to the authors in case of incorrect data") - async def _feedback_cmd(interaction: discord.Interaction["FrameDataBot"], message: str) -> None: + async def _feedback_cmd(interaction: discord.Interaction, message: str) -> None: logger.info( f"Received command from {interaction.user.name} in {interaction.guild}: /feedback {message}") if not ( @@ -158,8 +158,8 @@ async def _feedback_cmd(interaction: discord.Interaction["FrameDataBot"], messag logger.warning("Feedback or Action channel ID is not set. Disabling feedback command.") @self.tree.command(name="help", description="Show help") - async def _help_command(interaction: discord.Interaction["FrameDataBot"]) -> None: + async def _help_command(interaction: discord.Interaction) -> None: logger.info(f"Received command from {interaction.user.name} in {interaction.guild}: /help") if not (self._is_user_blacklisted(str(interaction.user.id)) or self._is_author_newly_created(interaction)): help_embed = embed.get_help_embed(self.frame_service) - await interaction.response.send_message(embed=help_embed, ephemeral=True) + await interaction.response.send_message(embed=help_embed, ephemeral=True) \ No newline at end of file