Files
fomo-reducer/src/command/render.rs

33 lines
965 B
Rust

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!();
}