From 3246164043069c251f6a9a373c2e3bd6c6ac6908 Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Fri, 15 May 2026 16:16:10 +0000 Subject: [PATCH 1/3] Implement defer --- cogs/add_users_to_threads_and_channels.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cogs/add_users_to_threads_and_channels.py b/cogs/add_users_to_threads_and_channels.py index 0eb478965..31aedde07 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() + 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() + 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, ) From da3924b3dfefdd83d3e5da8c8e6834f85f174d3c Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Fri, 15 May 2026 17:39:25 +0100 Subject: [PATCH 2/3] Make ephemeral Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> --- cogs/add_users_to_threads_and_channels.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/add_users_to_threads_and_channels.py b/cogs/add_users_to_threads_and_channels.py index 31aedde07..b54388bc8 100644 --- a/cogs/add_users_to_threads_and_channels.py +++ b/cogs/add_users_to_threads_and_channels.py @@ -217,7 +217,7 @@ async def add_user_to_channel( ) return - await ctx.defer() + await ctx.defer(ephemeral=True) try: user_to_add: discord.Member = await self.bot.get_member_from_str_id(user_id_str) From 5afada8ed73eb26fd5b1a2b53b446ee49810748b Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Fri, 15 May 2026 17:40:02 +0100 Subject: [PATCH 3/3] Make defer call ephemeral in add_users command Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> --- cogs/add_users_to_threads_and_channels.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/add_users_to_threads_and_channels.py b/cogs/add_users_to_threads_and_channels.py index b54388bc8..d8860b4d8 100644 --- a/cogs/add_users_to_threads_and_channels.py +++ b/cogs/add_users_to_threads_and_channels.py @@ -273,7 +273,7 @@ async def add_role_to_channel( ) return - await ctx.defer() + await ctx.defer(ephemeral=True) main_guild: discord.Guild = ctx.bot.main_guild