Skip to content
Advertisement

TypeError: on_message() missing 1 required positional argument: ‘message’

Hello I tried to make a bot with Discord.py and I tried implementing this to my code but I get the error in the title. I don’t know a lot of Python yet and I’m very new so I don’t know what may cause this error. Any help would be great, thanks!

JavaScript

Advertisement

Answer

Giving the full error log and the exact code run is good practice here.

This error indicates that the ‘on_message’ function was not given its ‘message’ argument. In this case, I would presume that you forgot to delete the ‘self’ argument when extracting this method from an object to make a stand-alone function out of it.

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