Add autoreact delete command

This commit is contained in:
Zeva Rose 2022-05-25 09:59:10 -06:00
parent a250f5278f
commit 65e9c78a4c

View file

@ -178,6 +178,24 @@ class AutoReactCog(Extension):
await self.delete_autoreact(ctx, channel) await self.delete_autoreact(ctx, channel)
await ctx.send(f"Removed {emote} from {channel.mention} autoreact.") await ctx.send(f"Removed {emote} from {channel.mention} autoreact.")
@autoreact.subcommand(
sub_cmd_name="delete",
sub_cmd_description="Delete an autoreact",
)
@slash_option(
name="channel",
description="Channel to remove autoreact from",
opt_type=OptionTypes.CHANNEL,
required=True,
)
@check(admin_or_permissions(Permissions.MANAGE_GUILD))
async def _autoreact_delete(self, ctx: InteractionContext, channel: GuildText) -> None:
result = self.delete_autoreact(ctx, channel)
if not result:
await ctx.send(f"No autoreact found in {channel.mention}", ephemeral=True)
else:
await ctx.send(f"Autoreact removed from {channel.mention}")
@autoreact.subcommand( @autoreact.subcommand(
sub_cmd_name="list", sub_cmd_name="list",
sub_cmd_description="List all autoreacts on a channel", sub_cmd_description="List all autoreacts on a channel",