feat: fix the command handler to reveal more data about the interaction
This commit is contained in:
@@ -2,7 +2,7 @@ use std::sync::LazyLock;
|
||||
|
||||
use twilight_model::application::{
|
||||
command::{Command, CommandType},
|
||||
interaction::application_command::CommandData,
|
||||
interaction::{Interaction, application_command::CommandData},
|
||||
};
|
||||
use twilight_util::builder::command::CommandBuilder;
|
||||
|
||||
@@ -19,6 +19,20 @@ pub static COMMAND: LazyLock<Command> = LazyLock::new(|| {
|
||||
});
|
||||
|
||||
#[tracing::instrument]
|
||||
pub async fn handle(state: State, data: CommandData) {
|
||||
todo!();
|
||||
pub async fn handle(state: State, interaction: Interaction) {
|
||||
let vcs = state.vcs;
|
||||
|
||||
let guild_id = interaction.guild_id.expect("TODO");
|
||||
// let user_id = data.user.map(|user| user.id).expect("TODO");
|
||||
|
||||
let user_id = interaction
|
||||
.member
|
||||
.and_then(|member| member.user.map(|user| user.id))
|
||||
.expect("TODO");
|
||||
|
||||
let guild_vcs = vcs.get(&guild_id).expect("TODO");
|
||||
tracing::error!(?guild_vcs, "TODO");
|
||||
|
||||
let user_in_vc_data = guild_vcs.get_left_and_data_for(&user_id);
|
||||
tracing::error!(?user_in_vc_data, "TODO");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user