streamocracy/commands/
mod.rs1use crate::config::Config;
2use serenity::all::{CommandInteraction, Context, CreateCommand};
3
4pub mod ping;
5pub mod votekick;
6
7#[serenity::async_trait]
9pub trait SlashCommand: Send + Sync {
10 fn name(&self) -> &'static str;
12
13 fn register(&self) -> CreateCommand;
15
16 async fn run(&self, ctx: Context, command: CommandInteraction, config: Config);
18}
19
20pub fn get_commands() -> Vec<Box<dyn SlashCommand>> {
22 vec![
23 Box::new(ping::PingCommand),
24 Box::new(votekick::VotekickCommand),
25 ]
26}