Skip to content
Advertisement

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 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

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

Advertisement