Skip to content
Advertisement

My warn command is not working discord.py

(Replit.com) I tried to use the warn command but every time i try, there is a error: TypeError: ‘Command’ object is not subscriptable

JavaScript

The error message I get is:

JavaScript

Advertisement

Answer

The problem is, that aside the report dictionary, you also have a command called report, so to fix this error, simply rename either the global variable or the command. Also instead of saving the users by name, you should save them by their id (current_user.id instead of current_user.name ), because Nitro users can change their discriminator to avoid any warns.

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