Geoffrey-rs/geoffrey_bot/src/bot/mod.rs

26 lines
923 B
Rust

use serenity::model::interactions::application_command::ApplicationCommand;
use serenity::prelude::*;
use commands::add_item::AddItemCommand;
use commands::add_location::AddLocationCommand;
use commands::find::FindCommand;
use commands::selling::SellingCommand;
use commands::set_portal::SetPortalCommand;
use commands::{BotCommand, CommandError};
pub mod arg_parse;
pub mod commands;
pub mod formatters;
pub async fn create_commands(ctx: &Context) -> Result<Vec<ApplicationCommand>, CommandError> {
let mut commands: Vec<ApplicationCommand> = Vec::new();
commands.push(FindCommand::create_app_command(ctx).await?);
commands.push(SellingCommand::create_app_command(ctx).await?);
commands.push(AddLocationCommand::create_app_command(ctx).await?);
commands.push(AddItemCommand::create_app_command(ctx).await?);
commands.push( SetPortalCommand::create_app_command(ctx).await?);
Ok(commands)
}