discord.py

How can I move a user to a specific voice channel?

How can I move a user to a specific voice channel? Question: I’m trying to create a system using Python that when a user joins a Discord VC by a specific ID, it moves them to a specific output/destination voice channel. I was wondering how to do this correctly. If possible, use pairs to have …

Total answers: 1

How to get a channel object using the client (in select callback) discord.py

How to get a channel object using the client (in select callback) discord.py Question: I have an issue getting a channel object (using the client) within a select callback. I don’t want to fetch using a guild id because one user will be in a DM channel (this command will have to work for one …

Total answers: 1

How can i add buttons afterly in Discord.py?

How can i add buttons afterly in Discord.py? Question: I am making a Discord bot for an order. And I need to make a role giver button list and add buttons to the first message after with a command I trying this for 2 days but I can’t add buttons only edit the first message …

Total answers: 1

discord.py's client.user.edit method generating error

discord.py's client.user.edit method generating error Question: I have created a discord price bot. It gets the price from the API and updates the nickname of my discord bot with that value. But I keep getting the error discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In username: You are changing your username or …

Total answers: 1

Tree command 2 arguments

Tree command 2 arguments Question: I have seen bots like Dyno that are able to have 2 arguments in one slash command, I would like to do the same thing with a DM slash command that would be something like this: /dm @user Hello! I have tried using this code in discord.py: @tree.command(guild=discord.Object(id=guild_id), name=’userping’, description=’DM …

Total answers: 1

Getting the newest line added to a json and sending in discord.py

Getting the newest line added to a json and sending in discord.py Question: I am making a discord bot using discord.py and have a nice little setup so when I add something to my json file it checks every 20 seconds and if something has changed then it will send a discord embed with the …

Total answers: 2

Discord.py recognizing on_message client event, but IF statements not responding

Discord.py recognizing on_message client event, but IF statements not responding Question: I am working on a Discord bot and in this case want the bot to roll a 6 sided die when any user gives the "roll" command. See code below. Oddly enough this was working just fine, but now the print(worked) triggers and the …

Total answers: 1

Can't add buttons to slash commands for my discord bot

Can't add buttons to slash commands for my discord bot Question: So I was trying to add buttons to slash commands using discord.py interactions and app_commands elements but when I try to run this code I get this error: error. I can’t find normal examples for discord.py implementations maybe somebody can help. Code: intents = …

Total answers: 1

AttributeError: 'submitButton' object has no attribute '_row' – Discord.py

AttributeError: 'submitButton' object has no attribute '_row' – Discord.py Question: I keep getting this error for a Discord.py button and after searching the internet I still cant find out why it is happening. Any help would be greatly appreciated. Thanks! AttributeError: ‘submitButton’ object has no attribute ‘_row’ class submitButton(discord.ui.Button): def __init__(self): @discord.ui.button(label="Submit Entry", style=discord.ButtonStyle.blurple, row=3) …

Total answers: 1

How do I close my Discord bot after it sends a message?

How do I close my Discord bot after it sends a message? Question: I am using a bot to send a message in between a program, utilising it as a function. def sendmessage(message): @client.event async def on_ready(): print(f'{client.user} has connected to Discord!’) CHANNEL_ID = (ID) channel = client.get_channel(int(CHANNEL_ID)) await channel.send(message) print("sent") client.run(TOKEN) After it sends …

Total answers: 1