Standard help command

This commit is contained in:
Lucy Bladen 2021-11-12 12:22:16 +00:00
parent 23985ec044
commit 2110f643de
1 changed files with 15 additions and 1 deletions

View File

@ -13,7 +13,7 @@ use crate::config::{Config, ManifoldConfig};
use serenity::prelude::*;
use serenity::framework::standard::{*, macros::*};
use serenity::http::Http;
use serenity::model::prelude::{GuildId, Message};
use serenity::model::prelude::{GuildId, Message, UserId};
use crate::error::ManifoldResult;
use crate::events::Handler;
use crate::responses::Responses;
@ -111,6 +111,7 @@ pub async fn prepare_client(arguments: ArgMatches<'_>) -> ManifoldResult<Client>
.case_insensitivity(true)
)
.before(before)
.help(&MANIFOLD_HELP)
.group(&CORE_GROUP);
let client = Client::builder(&token)
@ -145,6 +146,19 @@ async fn ping(ctx: &Context, msg: &Message) -> CommandResult {
Ok(())
}
#[help]
async fn manifold_help(
ctx: &Context,
msg: &Message,
args: Args,
help_options: &'static HelpOptions,
groups: &[&'static CommandGroup],
owners: HashSet<UserId>
) -> CommandResult {
let _ = help_commands::with_embeds(ctx, msg, args, help_options, groups, owners).await;
Ok(())
}
#[check]
#[name = "ModOrHigher"]
async fn mod_or_higher_check(ctx: &Context, msg: &Message, _: &mut Args, _: &CommandOptions) -> Result<(), Reason> {