just made a huge fucking mess

added SelectMenu for embeds
removed interactions (for now)
stupid macros
need to organize this shit asap
This commit is contained in:
2022-02-14 23:13:14 +05:30
parent 18b19f0695
commit a7a15dc3b1
7 changed files with 295 additions and 211 deletions

View File

@@ -2,15 +2,7 @@ mod count;
mod interactions;
use serenity::{
async_trait,
model::{
channel::Message,
event::ResumedEvent,
gateway::Ready,
interactions::{
ApplicationCommand, Interaction, InteractionData, InteractionResponseType,
InteractionType,
},
},
model::{channel::Message, event::ResumedEvent, gateway::Ready},
prelude::*,
};
use tracing::info;
@@ -19,12 +11,8 @@ pub struct Handler;
#[async_trait]
impl EventHandler for Handler {
async fn ready(&self, ctx: Context, ready: Ready) {
info!("{} connected bhay", ready.user.name);
let _ = ApplicationCommand::create_global_application_commands(&ctx.http, |commands| {
commands.set_application_commands(interactions::general())
})
.await;
async fn ready(&self, _: Context, ready: Ready) {
println!("{} connected bhay", ready.user.name);
}
async fn resume(&self, _: Context, _: ResumedEvent) {
info!("how th when the");
@@ -37,23 +25,4 @@ impl EventHandler for Handler {
.clone();
count::count(msg, db_client).await;
}
async fn interaction_create(&self, ctx: Context, interaction: Interaction) {
if interaction.kind == InteractionType::ApplicationCommand {
if let Some(InteractionData::ApplicationCommand(data)) = interaction.data.as_ref() {
if let Err(why) = interaction
.create_interaction_response(&ctx.http, |response| {
response
.kind(InteractionResponseType::ChannelMessageWithSource)
.interaction_response_data(|message| {
interactions::responses(data.name.to_string(), message)
})
})
.await
{
println!("Cannot respond to slash command: {}", why);
}
}
}
}
}