Skip to content

Commit 219e893

Browse files
authored
Merge pull request #847 from allthingslinux/afk_ephemeral
fix(afk): make afk command responses ephemeral
2 parents ffee016 + 0a6ddb6 commit 219e893

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tux/cogs/utility/afk.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,14 @@ async def afk(
5353

5454
await add_afk(self.db, shortened_reason, target, ctx.guild.id, False)
5555

56-
await ctx.send(
56+
await ctx.reply(
5757
content="\N{SLEEPING SYMBOL} || You are now afk! " + f"Reason: `{shortened_reason}`",
5858
allowed_mentions=discord.AllowedMentions(
5959
users=False,
6060
everyone=False,
6161
roles=False,
6262
),
63+
ephemeral=True,
6364
)
6465

6566
@commands.hybrid_command(name="permafk")
@@ -84,7 +85,7 @@ async def permafk(self, ctx: commands.Context[Tux], *, reason: str = "No reason.
8485
entry = await self.db.afk.get_afk_member(target.id, guild_id=ctx.guild.id)
8586
if entry is not None:
8687
await del_afk(self.db, target, entry.nickname)
87-
await ctx.send("Welcome back!")
88+
await ctx.send("Welcome back!", ephemeral=True)
8889
return
8990

9091
shortened_reason = textwrap.shorten(reason, width=100, placeholder="...")
@@ -99,6 +100,7 @@ async def permafk(self, ctx: commands.Context[Tux], *, reason: str = "No reason.
99100
everyone=False,
100101
roles=False,
101102
),
103+
ephemeral=True,
102104
)
103105

104106
@commands.Cog.listener("on_message")

0 commit comments

Comments
 (0)