My shedule script does not perform a function. I do everything as it should be, and the function does not call, so do not unmute and not print lol. When I put it instead of the print function, it was executed. I don't know what I'm doing wrong.
def unmutetempmute(ctx, member: discord.Member):
print('lol')
role = discord.utils.get(ctx.guild.roles, name='Wyciszony/a')
if role in member.roles:
unmuteembed = discord.Embed(
title='Odciszono {}!'.format(member.name),
color=28159,
description='Czas wyciszenia si? skończy?.')
ctx.channel.send(embed=unmuteembed)
member.send(embed=unmuteembed)
member.remove_roles(role)
return schedule.CancelJob
@client.command()
@commands.has_permissions(kick_members=True)
async def tempmute(ctx,
member: discord.Member,
time: int,
*,
reason='Nie podano powodu'):
role = discord.utils.get(ctx.guild.roles, name='Wyciszony/a')
if not role in member.roles:
muteembed = discord.Embed(
title='Wyciszono {}!'.format(member.name), color=28159)
muteembed.add_field(name='Powód:', value=reason, inline=False)
muteembed.add_field(
name='Czas:', value='{}m'.format(time), inline=False)
muteembed.add_field(
name='Administrator:', value=ctx.author.mention, inline=False)
await ctx.channel.send(embed=muteembed)
await member.send(embed=muteembed)
await member.add_roles(role)
await ctx.message.delete()
await schedule.every(time).seconds.do(
unmutetempmute, ctx=ctx, member=member)
return
errorembed = discord.Embed(
title='B??d!',
color=16711686,
description='U?ytkownik ju? jest wyciszony!')
await ctx.channel.send(embed=errorembed)
await ctx.message.delete()
question from:https://stackoverflow.com/questions/65887940/python-shedule-does-not-perform-a-function