I’d like to know if it’s possible to check if the last 2 messages in a channel (either the specific channel or the whole server, doesn’t really matter for my purpose) were sent by the same person in discord.py, e.g. something like this: Thanks. Answer You can get the channel of the message, and then get the history: Or, alternatively,
Tag: discord.py
How to terminate wait_for() when a condition is no longer met?
My discord.py command for a bot is supposed to activate a while loop under the condition that a specific variable has a certain value (with a wait_for() coroutine within it): It only executes while cond is True, however cond can change while wait_for() is running (I used a global variable for the example), and since this is a while loop
Discord.py error message: discord.ext.commands.bot: Privileged message content intent is missing
Can someone help me? I keep getting this error message when I try to start up my discord bot. This is the code for the bot and after this is just commands and events and client.run(My_Token) Answer You’ve got to change to It was an unmentioned change in the v2.0 discord.py update. https://discordpy.readthedocs.io/en/latest/migrating.html
Discord.py client.run and bot.run in one code
Not sure that I need to use the both runs at the same time, but: If you run this code and comment the “bot.run(‘ToKeN’)”, the first part of the code will work (def on_message), however the command ‘/help’ will not work. If you change it (comment ‘client.run(‘ToKeN’)’), the command ‘/help’ will work, but def on_message not. What are the possible
Error: discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction discord.py when sending a gif in embed
I’m making a discord bot that sends a message with two buttons. Both buttons sends a message with a picture/gif when pressed. One of them works but the other one gives an error: Here is the full code: Why does this happen? Answer With discord API you need to send an initial response within 3 seconds and afterward, you have
discord bot sends infinite messages regardless of user input
I’m trying to make a discord bot respond when someone makes laughing remarks but it infinitely sends gifs whenever someone types anything code is as follows Answer In addition to some formatting, I changed some of the variables for the API calls. I commented out the keep_alive.py as I assume you are using that to keep your code hosted on
discord.py – BanIterator object is not iterable
I’m trying to make an unban command but I have no way of getting the banned users list. This is the code: Error code: I tried even copying the code from this man (https://youtu.be/KS1_3km5vC0) but it doesn’t work. This is the code: Error code: This is all the bot code: Answer as in Documentation , you need to do it
Bare bones level system receiving errors [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 months ago. Improve this question I’m having issues with a very bare bones level system with my discord bot, here’s the error and code: The error: Answer What @larsks said
Ho to get exactly id from ping discord py
I want to create a command using id from pinged user and the return id like that : <@696986678887317556> and i want it : 696986678887317556, so i have coding this : And the result are this : <@696986678887317556 how i can code it pls 😠Answer The mentioned user will be in ctx.message.mentions so loop that or get the first
discord.py self-bot replies only to itself
I’m new at programming. I want to write a bot for my Discord channel to send users “hi” messages who send “hello”. But there is a problem, only I (the self bot) can receive the “hi!” message. When I write “hello” from another account, the bot doesn’t answer it. Note: I am using a self-bot, not a normal bot. Answer