Skip to content

Tag: discord

Why I can’t send messages in a @tasks.loop in

I have a problem: I can’t send message in a @tasks.loop() function. When I try to get the channel object with self.client.get_channel(channlid), it return me a Nonetype variable. My code : my error: Can you help me ? Answer Problem You’re calling client.get_channel before the client is ready. So, the client cannot find the channel you’re looking for, and channel

How to make this case insensitive

I’m not sure how I can use .toLowerCase() to make my discord command case insensitive this should be simple but I’m really new to this Answer In your handler where you check for the message content in the message event Have this done Eg: if(message.content.toLowerCase() === cmdName) return; 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: Here is part of my code that uses the ctx command. The aim is to get it to delete the last 3 messages