fmt: package it better
This commit is contained in:
parent
14cbf0bcad
commit
98e61d7548
2 changed files with 173 additions and 177 deletions
16
src/main.rs
16
src/main.rs
|
@ -4,10 +4,7 @@ use serenity::{
|
|||
async_trait,
|
||||
client::{Context, EventHandler},
|
||||
model::{
|
||||
application::{
|
||||
command::Command,
|
||||
interaction::{Interaction, InteractionResponseType},
|
||||
},
|
||||
application::{command::Command, interaction::Interaction},
|
||||
gateway::{GatewayIntents, Ready},
|
||||
guild,
|
||||
},
|
||||
|
@ -59,7 +56,7 @@ impl EventHandler for Handler {
|
|||
println!("[Main] {} is connected!", ready.user.name);
|
||||
|
||||
Command::set_global_application_commands(&ctx.http, |commands| {
|
||||
commands.create_application_command(|command| commands::link_email::register(command))
|
||||
commands.create_application_command(|command| commands::link_email::link::register(command))
|
||||
})
|
||||
.await
|
||||
.ok();
|
||||
|
@ -71,16 +68,11 @@ impl EventHandler for Handler {
|
|||
//println!("Received command interaction: {:#?}", command);
|
||||
|
||||
let content = match command.data.name.as_str() {
|
||||
"link" => commands::link_email::run(&command, &ctx).await,
|
||||
"link" => commands::link_email::link::run(&command, &ctx).await,
|
||||
_ => "not implemented :(".to_string(),
|
||||
};
|
||||
|
||||
if let Err(why) = command
|
||||
.edit_original_interaction_response(&ctx.http, |response| {
|
||||
response.content(content)
|
||||
})
|
||||
.await
|
||||
{
|
||||
if let Err(why) = command.edit_original_interaction_response(&ctx.http, |response| response.content(content)).await {
|
||||
println!("Cannot respond to slash command: {}", why);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue