aboutsummaryrefslogtreecommitdiff
path: root/src/commands/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/mod.rs')
-rw-r--r--src/commands/mod.rs32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index 4893e73..c8a7014 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -1,3 +1,4 @@
+use crate::util;
use log::info;
use serenity::framework::{
standard::macros::group,
@@ -9,10 +10,7 @@ pub use self::meme::*;
pub use self::{
playback::*,
roll::ROLL_COMMAND,
- today::{
- today,
- TODAY_COMMAND,
- },
+ today::TODAY_COMMAND,
};
pub(crate) mod playback;
@@ -38,16 +36,24 @@ pub fn register_commands(f: StandardFramework) -> StandardFramework {
let result = result.group(&crate::game::GAME_GROUP);
result.help(&help::HELP).unrecognised_command(|ctx, msg, unrec| {
- let url = match msg.content.split_whitespace().skip(1).next() {
- Some(x) if x.starts_with("http") => x,
- _ => {
- info!("bad command formatting: '{}'", unrec);
- let _ = ctx.send(msg.channel_id, "format your commands right. fuck you.", msg.tts);
- return;
- },
- };
+ Box::pin(async move {
+ let url = match msg.content.split_whitespace().skip(1).next() {
+ Some(x) if x.starts_with("http") => x,
+ _ => {
+ info!("bad command formatting: '{}'", unrec);
+ let _ = util::send(
+ ctx,
+ msg.channel_id,
+ "format your commands right. fuck you.",
+ msg.tts,
+ )
+ .await;
+ return;
+ },
+ };
- let _ = _play(ctx, msg, &url);
+ let _ = _play(ctx, msg, &url);
+ })
})
}