Skip to content

Commit

Permalink
Merge pull request #47 from 0xEmma/timeout-fix
Browse files Browse the repository at this point in the history
fix mute evasion
  • Loading branch information
dimoschi authored May 30, 2023
2 parents 0930562 + 79b4439 commit 799ddfe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cmds/core/mute.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ async def mute(
if isinstance(member, Member):
role = ctx.guild.get_role(settings.roles.MUTED)
await member.add_roles(role)
self.bot.loop.create_task(schedule(unmute_member(ctx.guild, member), run_at=datetime.fromtimestamp(dur)))

timestamp=datetime.fromtimestamp(dur)
self.bot.loop.create_task(schedule(unmute_member(ctx.guild, member), run_at=timestamp))
await member.timeout(timestamp, reason=reason if reason else "Time to shush, innit?")
try:
await member.send(f"You have been muted for {duration}. Reason:\n>>> {reason}")
except Forbidden:
Expand Down

0 comments on commit 799ddfe

Please sign in to comment.