feat: basic setup for link slash command
This commit is contained in:
parent
591c61b009
commit
14cbf0bcad
6 changed files with 238 additions and 41 deletions
|
@ -67,6 +67,7 @@ impl EventHandler for Handler {
|
|||
|
||||
async fn interaction_create(&self, ctx: Context, interaction: Interaction) {
|
||||
if let Interaction::ApplicationCommand(command) = interaction {
|
||||
let _ = command.defer_ephemeral(&ctx.http).await;
|
||||
//println!("Received command interaction: {:#?}", command);
|
||||
|
||||
let content = match command.data.name.as_str() {
|
||||
|
@ -75,10 +76,8 @@ impl EventHandler for Handler {
|
|||
};
|
||||
|
||||
if let Err(why) = command
|
||||
.create_interaction_response(&ctx.http, |response| {
|
||||
response
|
||||
.kind(InteractionResponseType::ChannelMessageWithSource)
|
||||
.interaction_response_data(|message| message.content(content).ephemeral(true))
|
||||
.edit_original_interaction_response(&ctx.http, |response| {
|
||||
response.content(content)
|
||||
})
|
||||
.await
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue