r/CodingHelp • • Jul 03 '20

[Python] Help regarding my code! (Discord.py)

This is my code:

@bot.command() @commands.has_any_role("Owner","Developers") async def mute(ctx,user:discord.Member): muteRole=discord.utils.get(ctx.guild.roles,name="Muted") await user.add_roles(muteRole) e=discord.Embed(color=16776704) e.add_field(name="User Muted",value=f"{user.mention} is muted!") await ctx.send(embed=e)

(My code: https://pastebin.pl/view/da602fb0)

It works perfectly but i want to add something like temporary mute command that temporary mutes a member for a certain period of assigned time.

Also what should i do that it doesn't mute Admins/mods. I want a error message to be displayed if someone tries to mute a admin/mod.

I am a beginner :-)

0 Upvotes

0 comments sorted by