Thomaskaldas22
Thomaskaldas22

Reputation: 1

cannot import name 'InvalidArgument' from 'discord'

I have a discord bot and I have made a ticket system, but what I am trying to do is making discord buttons for my command. When I ran the code, the below error code came up.

Code:

from discord import PartialEmoji, Emoji, InvalidArgument

Error:

ImportError: cannot import name 'InvalidArgument' from 'discord'

Upvotes: 0

Views: 1302

Answers (1)

Iain Shelvington
Iain Shelvington

Reputation: 32294

The InvalidArgument exception has been removed in version 2.0, you should raise a TypeError or ValueError instead

https://discordpy.readthedocs.io/en/latest/migrating.html?highlight=invalidargument#removal-of-invalidargument-exception

Upvotes: 1

Related Questions