Skip to content
12 changes: 7 additions & 5 deletions cogs/add_users_to_threads_and_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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}."
Expand Down Expand Up @@ -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:
Expand All @@ -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,
)
Loading