Reputation: 1
I am transitioning towards slash commands, and they are a pain in the neck. I have been sitting on my chair for a more than an hour. Here is the test slash command.
@slash.slash(name="test",
description="This is just a test command, nothing more.")
async def _test(ctx):
await ctx.channel.send("Hello World!")
I made this test slash command to see if it works. Long story short, it doesn't. I mean, It shows up, but it doesn't actually do anything. It just says "Interaction Failed." This isn't the only issue, the description also isn't there. It just shows the title, and to be honest, I don't want to die trying to fix this issue. Here is what I imported:
import discord
from discord.ext import commands
from discord_slash import SlashCommand, SlashContext
from discord_slash.utils.manage_commands import create_choice, create_option
I think I should mention that I do not get any errors, which is a bad thing. Any help will be appreciated.
Upvotes: 0
Views: 1982
Reputation: 638
When you're responding to the message you should use ctx.send
to respond to the interaction instead of ctx.channel.send
to send a POST request into the channel. If you don't respond to the interaction then you get the interaction failure message.
You can also respond using ctx.defer
, which gives you up to 15 minutes to respond to your interaction otherwise.
Upvotes: 1