Skip to content

Commit

Permalink
format: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jan 24, 2023
1 parent bcf9fb1 commit 2dcdbe5
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions cogs/misc/auto_react.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class AutoReact(commands.GroupCog, group_name="auto_react"):
def __init__(self, bot: TakoBot):
self.bot = bot

@app_commands.command(description="Add an emoji that will be automatically added to every new message in the channel")
@app_commands.command(
description="Add an emoji that will be automatically added to every new message in the channel"
)
@app_commands.describe(
emoji="The emoji to add. Can be a custom emoji or a unicode emoji.",
channel="The channel to add the emoji to. If not specified, the current channel will be used.",
Expand Down Expand Up @@ -46,10 +48,13 @@ async def add(self, interaction: discord.Interaction, emoji: app_commands.Transf
data,
)
return await interaction.response.send_message(
i18n.t("misc.auto_react_added", emoji=emoji, channel=channel.mention), ephemeral=True
i18n.t("misc.auto_react_added", emoji=emoji, channel=channel.mention),
ephemeral=True,
)

@app_commands.command(description="Remove an emoji that will be automatically added to every new message in the channel")
@app_commands.command(
description="Remove an emoji that will be automatically added to every new message in the channel"
)
@app_commands.describe(
emoji="The emoji to remove. Can be a custom emoji or a unicode emoji.",
channel="The channel to remove the emoji from. If not specified, the current channel will be used.",
Expand Down Expand Up @@ -79,7 +84,8 @@ async def remove(self, interaction: discord.Interaction, emoji: app_commands.Tra
data,
)
return await interaction.response.send_message(
i18n.t("misc.auto_react_removed", emoji=emoji, channel=channel.mention), ephemeral=True
i18n.t("misc.auto_react_removed", emoji=emoji, channel=channel.mention),
ephemeral=True,
)

@remove.autocomplete("emoji")
Expand All @@ -97,14 +103,16 @@ async def autocomplete_callback(
if current.lower() in emoji
]

@app_commands.command(description="List all emojis that will be automatically added to every new message in the channel")
@app_commands.command(
description="List all emojis that will be automatically added to every new message in the channel"
)
@app_commands.describe(
channel="The channel to list the emojis from. If not specified, the current channel will be used.",
)
async def list(self, interaction: discord.Interaction, channel: discord.TextChannel = None): # type: ignore
if not channel:
channel = interaction.channel # type: ignore
channel = interaction.channel # type: ignore

data = await self.bot.db_pool.fetchval(
"SELECT auto_react FROM channels WHERE channel_id = $1", channel.id
)
Expand All @@ -113,10 +121,9 @@ async def list(self, interaction: discord.Interaction, channel: discord.TextChan
i18n.t("misc.auto_react_empty", channel=channel.mention), ephemeral=True
)
return await interaction.response.send_message(
i18n.t("misc.auto_react_list", emojis=", ".join(data), channel=channel.mention), ephemeral=True # type: ignore
i18n.t("misc.auto_react_list", emojis=", ".join(data), channel=channel.mention), ephemeral=True # type: ignore
)


@commands.Cog.listener()
async def on_message(self, message: discord.Message):
data = await self.bot.db_pool.fetchval(
Expand Down

0 comments on commit 2dcdbe5

Please sign in to comment.