Remove unrecognized command hook

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/2/head
trivernis 3 years ago
parent 1d0fa1816c
commit 1fad2950b5
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -49,7 +49,6 @@ pub fn get_framework() -> StandardFramework {
.group(&MUSIC_GROUP)
.after(after_hook)
.before(before_hook)
.unrecognised_command(unknown_command)
.on_dispatch_error(dispatch_error)
.help(&HELP)
}
@ -68,15 +67,6 @@ async fn before_hook(ctx: &Context, msg: &Message, _: &str) -> bool {
let _ = msg.channel_id.broadcast_typing(ctx).await;
true
}
#[hook]
async fn unknown_command(ctx: &Context, msg: &Message, cmd: &str) {
let _ = msg
.channel_id
.say(ctx, format!("Could not find the command `{}`", cmd))
.await;
}
#[hook]
async fn dispatch_error(ctx: &Context, msg: &Message, error: DispatchError) {
match error {

@ -1,14 +1,13 @@
use std::collections::HashSet;
use serenity::client::Context;
use serenity::framework::standard::{Args, help_commands};
use serenity::framework::standard::{CommandGroup, CommandResult, HelpOptions};
use serenity::framework::standard::macros::help;
use serenity::framework::standard::{help_commands, Args};
use serenity::framework::standard::{CommandGroup, CommandResult, HelpOptions};
use serenity::model::channel::Message;
use serenity::model::id::UserId;
#[help]
#[description("HEEEELP")]
pub async fn help(
ctx: &Context,
msg: &Message,

Loading…
Cancel
Save