Skip to content

How do i send an embed as a slash command? #2936

Answered by jamesbt365
RealMrCactus asked this question in Q&A
Discussion options

You must be logged in to vote

It is much easier for you to use poise, but if you really don't want to, and haven't already, check out the example for doing slash commands in serenity.

Doing it directly in serenity is not pretty by any means, you have to:

  • Build the structure and register your commands manually
  • Handle the InteractionCreate event, match the enum for CommandInteraction
  • Parse the interaction to get the arguments out manually
  • Then send a response either through the create_response method or the create_followup method, depending on if you have already sent a response or not.

It certainly isn't pretty, but if you don't want to use poise that is how you have to do it. See the example for a full rundown.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jamesbt365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants