p4bl0t/src/discord/commands.rs

20 lines
534 B
Rust
Raw Normal View History

2023-11-22 21:38:21 +01:00
use super::{Context, Error};
use super::utils::serenity;
#[poise::command(slash_command)]
pub async fn add_logging_channel(
ctx: Context<'_>,
#[description = "Selected channel"] channel: Option<serenity::Channel>,
) -> Result<(), Error> {
let response = match channel {
None => "No channel selected. Please select one.".to_owned(),
Some(chan) => {
let channel_id = chan.id();
format!("Selected channel <#{channel_id}>")
}
};
ctx.say(response).await?;
Ok(())
}