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
Tag: discord
Make Discord.py Bot Only Work In Specific Channels
I was making a bot for my friend using discord.py and I wanted to make it so that it would only work in channel which include the word ticket, made by another bot named Ticket Toll How can I do so? Answer Relevant docs on text channels Unfortunately, Discord’s API does not keep track of who created the channel (which
discord.embed update with role reaction
I’m trying to update a discord.embed with reaction: I create a discord embed with some default information, and add the reaction I want to use, the idea is that when someone react with one of the select reaction, the name of the user is added to the field. ( I actually have 4 commands using the same “template” with the
How to tag a user using the discord.Member argument?
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
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
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
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”.
changing the embed’s footer
i have this code that would change an embed’s footer and resend it to the log channel, but now it doesn’t work anymore for somereason this is the code: and this is the error i get: Answer The argument for set_footer is keyword-only:
(discord.py) change discord avatar with someone’s avatar url
I’m trying to change my bot’s avatar with the avatar url of someone in my server. The code isn’t working. Any help? Answer The other answer says you have to have a bytes-like object, which is true. Adding onto it though: you can retrieve the image as a bytes-like object with requests like: img = requests.get(url).content which you can then
How to fix discord music bot attribute
Error: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: ‘VoiceState’ object has no attribute ‘voice_channel’ Code: Answer Try using voice.channel instead of voice.voice_channel. Also client.join_voice_channel will not work. Use something like this: