#Time mute

1 messages · Page 1 of 1 (latest)

tight socket
#

Hello! How can I make the mute command so that it gives the participant a role and removes, let's say, after 10 seconds?

soft obsidian
#

Add the user ID and time to remove the role in a database table.

Then use tasks to check the database table periodically.

There's probably a few ways to do it but that should work to get you started.

tight socket
tight socket
tight socket
tight socket
vivid marten
#

@tight socket @tight socket If you use asyncio.sleep, you risk the timer being stopped if you restart your bot. I recommend using the tasks TheMilkMan mentioned for better results.

#

Or you can use Discord’s timeout feature that doesn’t use a rule and is easier

#

.docslink discord.Member.timeout_for

tight socket
tight socket
autumn breach
autumn breach
tight socket
tight socket
# autumn breach ?

await member.timeout(until=datetime.utcnow() + duration, reason=reason) ?

autumn breach
#

?tag tias

delicate haloBOT
tight socket
vivid marten
#

.tag tias

mortal barnBOT
tight socket
autumn breach
#

OK?

#

Don't know what you were expecting

tight socket
cedar plinth
#

xd

hard vale
#

.

autumn breach
#

You could have saved about 11 hours if just tested it