Coding Global Background
Coding Global

Discord bot slash commands

Archived 2 years ago
4 messages
2 members
3 years ago
Open in Discord
G
Ghetto Günther
Verified

Hello, I am currently programming a Dungeon and Dragons Discord bot. I want to make a slash command with autocomplete that can send one of 9 embed lists to the channel. The command should be: /spells [class name (wizard)] <- Output: an embedded list with all class spells. I tried this, but I don't know what I'm doing wrong or how this works. I've seen a lot of tutorials and documentation, but I don't get it. The current command is: !wizzard_spells ```py @bot.command() async def wizzard_spells(ctx): # Erstellen des Embeds embed = discord.Embed(title="Wizzard Spell-Liste", color=discord.Color.red()) for level, spells in wizzard_spells_data.items(): spell_list = '\n'.join(spells) embed.add_field(name=level, value=spell_list, inline=False) # Nachricht mit Embed senden await ctx.send(embed=embed) ``` If it helps more, here is all the code: https://github.com/HolyCodez/dnd-discord-bot/blob/main/dungeon.py i hope someone can help me

Replies (4)