Skip to content
Advertisement

Getting error on discord bot discord.py for typing in role

I get this error on my bot when mentioning a role,here is the error,

raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: unhashable type: ‘set’

my code:

JavaScript

What’s meant to happen: Me:-war Bot:Are you sure Me:reacts Bot:Type in role Me:(role name) Bot:….

Advertisement

Answer

JavaScript

is a set literal for a set containing a number. is using hashing under the hood to look up channels, which is failing because it is not possible to hash sets. You should be passing a regular int instead of a set:

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