diff --git a/cogs/add_users_to_threads_and_channels.py b/cogs/add_users_to_threads_and_channels.py index 0eb47896..d8860b4d 100644 --- a/cogs/add_users_to_threads_and_channels.py +++ b/cogs/add_users_to_threads_and_channels.py @@ -217,6 +217,8 @@ async def add_user_to_channel( ) return + await ctx.defer(ephemeral=True) + try: user_to_add: discord.Member = await self.bot.get_member_from_str_id(user_id_str) except ValueError: @@ -229,7 +231,7 @@ async def add_user_to_channel( else: await self.add_users_or_roles_with_ping(user_to_add, ctx.channel) - await ctx.respond( + await ctx.followup.send( content=( f"Successfully added {user_to_add.mention} " f"to the channel: {ctx.channel.mention}." @@ -265,14 +267,14 @@ async def add_role_to_channel( silent: bool, # noqa: FBT001 ) -> None: """Command to add a role to a channel.""" - if not isinstance(ctx.channel, discord.Thread) and not isinstance( - ctx.channel, discord.TextChannel - ): + if not isinstance(ctx.channel, (discord.TextChannel, discord.Thread)): await self.command_send_error( ctx, message="This command can only be used in a text channel or thread." ) return + await ctx.defer(ephemeral=True) + main_guild: discord.Guild = ctx.bot.main_guild try: @@ -295,7 +297,7 @@ async def add_role_to_channel( else: await self.add_users_or_roles_with_ping(role_to_add, ctx.channel) - await ctx.respond( + await ctx.followup.send( content=f"Role {role_to_add.mention} has been added to the channel.", ephemeral=True, )