Skip to content
Advertisement

Programming a Discord bot in Python- Can’t figure out how to set up reaction roles

I’m working on setting up reaction roles with my bot, here’s my code:

JavaScript

Whenever a certain reaction is added, instead of giving a role it gives me an error:

JavaScript

Not sure how to fix this, any tips?

Advertisement

Answer

JavaScript

this will only define role when these conditions are met. You should probably define it before doing this comparison, or have an else: to catch and define it.

JavaScript

or

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement