Skip to content

Commit ee73101

Browse files
committed
refactor(timeout): use tick method, not add_reaction
1 parent cf32759 commit ee73101

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

timeout/timeout.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async def timeout_add(self, ctx: commands.Context, user: discord.Member, reason:
9393
await ctx.send("Something went wrong!")
9494
raise Exception(error) from error
9595
else:
96-
await ctx.message.add_reaction("✅")
96+
await ctx.tick()
9797

9898
# Send report to channel
9999
if await self.config.guild(ctx.guild).report():
@@ -119,7 +119,7 @@ async def timeout_remove(self, ctx: commands.Context, user: discord.Member, reas
119119
await ctx.send("Something went wrong!")
120120
raise Exception(error) from error
121121
else:
122-
await ctx.message.add_reaction("✅")
122+
await ctx.tick()
123123

124124
# Clear user's roles from config
125125
await self.config.member(user).clear()
@@ -150,7 +150,7 @@ async def timeoutset_logchannel(self, ctx: commands.Context, channel: discord.Te
150150
- `[p]timeoutset logchannel #mod-log`
151151
"""
152152
await self.config.guild(ctx.guild).logchannel.set(channel.id)
153-
await ctx.message.add_reaction("✅")
153+
await ctx.tick()
154154

155155
@timeoutset.command(name="report", usage="<enable|disable>")
156156
@checks.mod()
@@ -173,7 +173,7 @@ async def timeoutset_report(self, ctx: commands.Context, choice: str):
173173
if str.lower(choice) == "enable":
174174
if log_channel:
175175
await self.config.guild(ctx.guild).report.set(True)
176-
await ctx.message.add_reaction("✅")
176+
await ctx.tick()
177177
else:
178178
await ctx.send(
179179
"You must set the log channel before enabling reports.\n" +
@@ -182,7 +182,7 @@ async def timeoutset_report(self, ctx: commands.Context, choice: str):
182182

183183
elif str.lower(choice) == "disable":
184184
await self.config.guild(ctx.guild).report.set(False)
185-
await ctx.message.add_reaction("✅")
185+
await ctx.tick()
186186

187187
else:
188188
await ctx.send("Setting must be `enable` or `disable`.")
@@ -196,7 +196,7 @@ async def timeoutset_role(self, ctx: commands.Context, role: discord.Role):
196196
- `[p]timeoutset role MyRole`
197197
"""
198198
await self.config.guild(ctx.guild).timeoutrole.set(role.id)
199-
await ctx.message.add_reaction("✅")
199+
await ctx.tick()
200200

201201
@timeoutset.command(name="list")
202202
@checks.mod()

0 commit comments

Comments
 (0)