Skip to content
Advertisement

Discord.py ctx commands not recognised

im fairly new to coding in general and recently started trying to code my own bot. Almost all of the tutorials i have seen use the ctx command however, whenever i use it i get this error:

JavaScript

Here is part of my code that uses the ctx command. The aim is to get it to delete the last 3 messages sent.

JavaScript

Full error:

JavaScript

I’m hosting the server on repl.it if that makes any difference and as i said, im pretty new to coding so it’s possible i have missed something very obvious, any help is appreciated. ^_^

Advertisement

Answer

A fix to that is:

JavaScript

The problem is the on_message function uses message and not ctx. Replacing message with ctx wont work because im pretty sure the on_message cant use ctx

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