Answer the question
In order to leave comments, you need to log in
Discord.py sleep per function?
Good day forum users!
There is a ds bot in python. Added the function of mute and auto unmute.
@bot.command(pass_context=True)
@commands.has_permissions(administrator = True)
async def user_mute(ctx,member:discord.Member):
await ctx.channel.purge(limit = 1)
mute_role = discord.utils.get(ctx.message.guild.roles,name = 'mute')
await member.add_roles(mute_role)
await ctx.send(f'{member.mention} получил мут за плохое поведение!')
time.sleep(30)
unmute = discord.utils.get(ctx.message.guild.roles,name = 'mute')
await member.remove_roles(unmute)
Answer the question
In order to leave comments, you need to log in
import asyncio
asyns def():
...
await asyncio.sleep(30)
....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question