chore: very beginning of making a /render command
This commit is contained in:
32
src/command/render.rs
Normal file
32
src/command/render.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
use std::sync::LazyLock;
|
||||
use twilight_model::application::{
|
||||
command::{Command, CommandType},
|
||||
interaction::Interaction,
|
||||
};
|
||||
use twilight_util::builder::command::CommandBuilder;
|
||||
|
||||
use crate::command::State;
|
||||
|
||||
const NAME: &str = "render";
|
||||
const DESCRIPTION: &str = "(Only the bot owner can use this) Render a composite audio file from the specified range of voice chat";
|
||||
|
||||
pub static COMMAND: LazyLock<Command> = LazyLock::new(|| {
|
||||
CommandBuilder::new(NAME, DESCRIPTION, CommandType::ChatInput)
|
||||
.validate()
|
||||
.expect("command wasn't correct")
|
||||
.build()
|
||||
});
|
||||
|
||||
#[tracing::instrument]
|
||||
pub async fn handle(state: State, interaction: Interaction) {
|
||||
let bot_owner_user_id = state.discord_bot_owner_user_id;
|
||||
|
||||
let is_bot_owner = interaction
|
||||
.member
|
||||
.as_ref()
|
||||
.and_then(|member| member.user.as_ref().map(|user| user.id))
|
||||
.map(|user_id| user_id == bot_owner_user_id)
|
||||
.unwrap_or(false);
|
||||
|
||||
todo!();
|
||||
}
|
||||
Reference in New Issue
Block a user