Relative Content

Tag Archive for discord.py

What types of annotations for slash commands does Discord support?

Recently returned to learning about bot development on discord.py. I tried a long time ago, but nothing worked. Now I took it seriously and while testing various features of discord.py after version 2.0, I wanted to find out what types of data discord.py provides. I mean for example discord.Mmeber, discord.TextChannel etc. I would like to know all such data types for the arguments of my commands (if I understand correctly what I am writing 🙂 ).
Thank you for your answers, I will be very happy to read about this and what has changed since the discord.py 2.0 update.

Get .txt file from discord message

When someones sends a message over 4,000 characters, the message gets sent into a .txt file instead, making it impossible to get the message content with message.content, i’m therefore looking for a way to read the .txt file

How do I only fetch channel names on discord?

I want to write a program that checks all the channel names in discord and checks a list with names. If the name on the list is not in the channel list, it will create a new channel with that name, but I can’t seem to find an eazy, straight forward method to fetch channel names. My bot is only used in my server and will not expand. Therefore it is not necessary to use GuildID’s. The code that I have right now looks like this:

I am getting a logging in using static token error and I don’t know how to fix it

I’m in the process of creating a Discord bot, I can’t seem to get it working. Whenever I run main.py it returns with the error message [2024-07-02 17:20:46] [INFO ] discord.client: logging in using static token. My bot token seems up to date in my .env file and it matches with the discord bot token in the Developer portal. This is the code I have in main.py

Discord.py command don’t work with parameter

i recently added a parameter to my slashcommand in discord, and since the command refuses to work. i get no response from the bot. the first code block works fine, but the second one doesnt.

TypeError: Guild._create_channel() missing 1 required positional argument: ‘name’

@bot.tree.command(description=”Cria os canais automaticamente”) async def criarcanal(interact:discord.Interaction): discord.Permissions.manage_channels channel = await Guild.create_text_channel(name=(“canalglg”),self=(Guild)) await channel.send(‘Ui Gutts’) Translate Plis:Eu tentei criar um canal no discord utilizando um bot porem sempre da um error que esta faltando um argumento sempre dando name ou self quando eu colocou o argumento dos 2 sempre da um eror que name esta […]