i am trying to make the bot give the 'mall' role and remove the 'study hall' role. However, it keeps returning the error
Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\frost\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\client.py", line 333, in _run_event await coro(*args, **kwargs) File "D:\GalaxyConflux Master\gcclient.py", line 89, in on_message role.id = 798193741403127818 AttributeError: 'str' object has no attribute 'id'
the code that is running is this
@client.event
async def on_message(message):
if message.content.startswith(gccmd.cmd_prfx + 'mall'):
role = 'Mall'
role.id = 798193741403127818
await message.author.add_roles(role.id)
i have tried many different approaches but each result in a similar error. I had it just go off of the role = 'Mall' part but that did not work either.
How can I convert the role id into an actual id?
Thanks so much! ~Glimmer