Skip to content

Commit

Permalink
Remove ["FrameDataBot"] as test
Browse files Browse the repository at this point in the history
  • Loading branch information
TLNBS2405 committed Mar 11, 2024
1 parent 16c749d commit c126cf8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/heihachi/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 (
Expand Down Expand Up @@ -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)

0 comments on commit c126cf8

Please sign in to comment.