moved database-related commands into subcommands & added wwrps database entry

This commit is contained in:
2026-02-27 13:00:40 +01:00
parent b3a6a7eb25
commit 650cb98a3e
8 changed files with 83 additions and 26 deletions
+35
View File
@@ -0,0 +1,35 @@
use crate::{Context, Error, db_cmds::{add_server, reddit_channel, wwrps_channel}};
#[derive(poise::ChoiceParameter, PartialEq)]
pub enum Subcommands {
AddServer,
RedditChannel,
WWRPSChannel
}
#[poise::command(
slash_command,
prefix_command,
category = "db",
rename = "database",
owners_only,
default_member_permissions = "ADMINISTRATOR",
required_bot_permissions = "SEND_MESSAGES | VIEW_CHANNEL"
)]
/// Various debug utilities
pub async fn cmd(
ctx: Context<'_>,
#[description = "Subcommand"] subcommand: Subcommands,
) -> Result<(), Error>
{
match subcommand {
Subcommands::AddServer => add_server::cmd(ctx).await?,
Subcommands::RedditChannel => reddit_channel::cmd(ctx).await?,
Subcommands::WWRPSChannel => wwrps_channel::cmd(ctx).await?,
//_ => return Ok(())
}
return Ok(());
}