I have a discord bot with the command !sad. On execution the bot should reply with a random string from sad_list. I want the option to have the bot tag someone if you execute the command with the user: discord.Member argument. Preferred output: as opposed to only The following has already been tried: However this simply writes: As opposed to
Tag: discord.py
How do I make my discord bot play music by using youtubedl’s search function instead of url? (Python)
I want it to search for the video and play it, how can i change the following code to achieve that? Every time I use the ytsearch function in ytdl, I notice that it only searches for the first word of the title and download it, however, it causes error later on and do nothing. And this is the error
Discord Python Raspbian Error invalid syntax when running script
This is my first time writing in this platform. I got an error on my RPi when hosting a discord music bot using lavalink. Currently, my problem is that there’s a invalid syntax error on a line of code. The weird part is that I don’t get this error when I use VSCode on Windows 10. It also ran perfect
My warn command is not working discord.py
(Replit.com) I tried to use the warn command but every time i try, there is a error: TypeError: ‘Command’ object is not subscriptable The error message I get is: Answer The problem is, that aside the report dictionary, you also have a command called report, so to fix this error, simply rename either the global variable or the command. Also
How do I merge values into one message in discord.py
I want my bot to be able to say a message, mention a user, then respond with a random message, all in the same line, as opposed to having it in 3 separate lines. This was my previous method: However, this makes them all appear in the same line, but I can’t figure out how to merge them into a
Why error handling doesn’t work in repl but in VSCode it does? discord.py
I am trying to handle errors for local commands of my discord bot and I get the following error discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: ‘Command’ object has no attribute ‘MissingRequiredArgument’ this only happens when I execute the code in repl and not in VSCode.I also tried the following Answer You should send the complete code, but if I understood
Discord.py AttributeError(“‘NoneType’ object has no attribute ‘roles'”)
This bot gives out a role when you click on a reaction in a message, when you delete a reaction, it takes it away, this code worked a year ago and there were no problems, now I run it and get I tried to look on the Internet and it seems that I have everything right, I don’t understand where
Count members that they are connected to voice
I use this code to count discord members and I wanna add active mics to activity too (I mean the users that they are connected to voice) I tried many ways but I failed Answer I add it a loop that refresh the status.
Can’t return the first function from Bot.event on_message
Code Here’s (a little part) of my code: There’s no error raised with my code. Problem return makes the Spy command end, but events keep running. Question Do you know how to make all the events (on_typing and on_message aren’t the only ones) end with the return? Thanks in advance! Answer Answer Maybe I found the answer to my own
Hosting discord bot through Heroku – deploy error
I am trying to host my discord bot through heroku. I’m coding with python. But I got the following error when deploying from GitHub: That was the full build log that I saw on heroku. Can anyone help? Thx Answer You should change the first line in requirements.txt to git+https://github.com/Rapptz/discord.py. Because there is no tag or branch named “rewrite”.