I want my discord.py Bot to remove the muted role after a certain amount of time, which would be specified by the moderator running the "Mute" command.
I tried putting an argument after 'ctx', which would be the time specified to mute.
@bot.command(name='mute', pass_context=True)
@commands.has_role('mod')
async def mute(ctx, member=None, val: int=None):
ab = member
ab = ab.replace("<","")
ab = ab.replace(">","")
ab = ab.replace("@","")
ab = ab.replace("!","")
member = ctx.guild.get_member(int(ab))
role = discord.utils.get(ctx.guild.roles, name="muted")
await member.add_roles(role)
await ctx.send("muted")
it would raise the error 'AttributeError: 'NoneType' object has no attribute 'add_roles''