None of my ctx commands work. Here I’ll give an example. When I say p!test I want it to print hi and say test, but it’s not responding. Can someone help? Answer If you’re using a on_message event, you have to ‘process commands’ in the last line of the event. Otherwise, your commands won’t work. Reference discord.ext.commands.Bot.process_commands
Tag: discord.py
Retrieving a message from on_raw_reaction_add discord.py
I’ve been trying to make it so the bot removes the reaction using discord.Message.remove_reaction(), but I can’t find a way to actually retrieve and store the message in a variable. Does anybody know how to do this? Here is the code I have so far: Answer on_raw_reaction_add returns a RawReactionActionEvent which has a message_id attribute. You can pass it to
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! Answer Giving the full error log and the
The code keeps on trowing an error “`The command help is already an existing command or alias“` Why is this so and how do I fix it?
Im working on a discord bot in python but as soon as I run the code it shows an error The command help is already an existing command or alias. and it isn’t anywhere else in the code. Here is the code Answer The help command already exists so you need to remove the default one to overwrite it:
My bot wont run the on_message/on_ready event properly
When i tried to start up my bot, it wouldnt run the on_message event and it wouldnt run the on_ready event either. Here is my code: I have tried to get rid of the on_message event to see if that was the problem, and it didnt fix it. Does anyone have a fix for this? Answer You are not actually
How can I make the bot say something when someone tries to kick a higher admin or himself?
When someone tries to kick a higher in rank admin the bot does nothing not even an error, I want it instead to return a text into chat. Also if someone tries to kick/ban himself it works, how can I disable that? Thanks here is the code Answer you can compare top_role of the members
How do I create a custom cycling status in discord.py?
I have a discord bot that I’m using to learn how to use the API and to practise my python knowledge. I’m trying to create a system that randomly chooses a status and applies it then waits a short time, currently 10 minutes, then continue like that infinitely until the bot is shutdown. Currently, I have the loop in my
Discord Python Bot Multiple Value in embed field
So i have a discord bot (using python) that connect to a sqlite database, and i want to show the data using embed. The data is containing my daily anime schedule. Here’s the code : The problem is this Discord Embed There are 2 ‘Sunday’ which is not what i wanted. What i want is (example for Sunday), the ‘Value’
how to get a apis output in python without json
here is api i am trying https://api.apithis.net/host2ip.php?hostname=google.com as you can see unlike json apis it dose not have “” that you can copy as response.json here is my current code if anyone can fix would help alot as im not sure how to use apis without json output thanks Answer Firstly the response you are getting is not JSON. If
How to stop limit of channel.purge decreasing when check returns false?
I have a command that is meant to go through and remove the last x number of messages sent by bots in a channel. However, the command removes all messages from bots in the last x messages instead of removing the last x number of messages from bots. Is there a way that I can check if x number of