Answer the question
In order to leave comments, you need to log in
I can't find the error. I allowed it somewhere and the command does not work?
Here is the code! After adding the time conversion command stopped working
@client.command()
@commands.has_any_role(863812051750617150, 863889397685682206 ,863812064169164830, 863811504561061889, 863812595663896587, 863812764941680651, 863791521823719425, 863797986248359957, 863812678354993198)
async def заткнуть(ctx,member:discord.Member,time=0,*, reason=None):
role = discord.utils.get(ctx.guild.roles,id=863819862329131009)
await member.add_roles(role)
author = ctx.message.author
emb = discord.Embed(title='Вердикт',colour=discord.Colour.from_rgb(255, 255, 0))
emb.add_field(name='Великий модератор',value=ctx.message.author.mention,inline=False)
emb.add_field(name='Замьютил',value=member.mention,inline=False)
emb.add_field(name='По причине',value=reason,inline=False)
emb.add_field(name='На',value=str,inline=False)
await ctx.send(embed=emb)
time_convert = {"с": 1, "м": 60, "ч": 3600, "д": 86400}
def convert_time_to_seconds(time):
try:
return int(time[:-1]) * time_convert[time[-1]]
except:
return time
await asyncio.sleep(time)
await member.remove_roles(role)
Answer the question
In order to leave comments, you need to log in
Possibly omitted : That is:
return int(time[:-1]) * time_convert[time[:-1]]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question