#Time mute
1 messages · Page 1 of 1 (latest)
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.
So I'm wondering if it's possible to use asyncio.sleep(time)?
?
.
yes you can
thx
role = #Getting role
await member.add_role(role)
asyncio.sleep(time)
await member.remove_role(role)
So?
?
@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
And how can it be used?
but this is only 10 seconds so he can
It was an example.
Read the docs.
where?
await member.timeout(until=datetime.utcnow() + duration, reason=reason) ?
?
?tag tias
what?
ok?
Yes it "ok?"
xd
.
?
Try it and see.
You could have saved about 11 hours if just tested it