I am trying to make a bot that makes a channel and gives you a role when you enter a command, I have been trying to get the role part working for quite a while but I always end up with errors after errors- this is my current code-
@bot.command(name= 'playfata') async def playfata(ctx): member = ctx.author role = discord.utils.get(member.guild.roles, name="Currently Playing") if role in member.roles: await ctx.send("You already have that role") else: await member.add_roles(role)
and this is the error I end up receiving with this one-
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'id'
I tried almost everything I could find on the internet and nothing seems to have helped.