From 068fdc8974cb7cc6c11fb6ce83014d7712ecbf17 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Mon, 9 Dec 2019 15:38:44 -0500 Subject: [PATCH] Base for community --- youmubot/src/commands/community/mod.rs | 13 +++++++++++++ youmubot/src/commands/{fun => community}/votes.rs | 0 youmubot/src/commands/fun/mod.rs | 4 +--- youmubot/src/commands/mod.rs | 2 ++ youmubot/src/main.rs | 6 +++++- 5 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 youmubot/src/commands/community/mod.rs rename youmubot/src/commands/{fun => community}/votes.rs (100%) diff --git a/youmubot/src/commands/community/mod.rs b/youmubot/src/commands/community/mod.rs new file mode 100644 index 0000000..4ddad82 --- /dev/null +++ b/youmubot/src/commands/community/mod.rs @@ -0,0 +1,13 @@ +use serenity::framework::standard::macros::group; + +mod votes; + +use votes::VOTE_COMMAND; + +group!({ + name: "community", + options: { + description: "Community related commands. Usually comes with some sort of delays, since it involves pinging", + }, + commands: [vote], +}); diff --git a/youmubot/src/commands/fun/votes.rs b/youmubot/src/commands/community/votes.rs similarity index 100% rename from youmubot/src/commands/fun/votes.rs rename to youmubot/src/commands/community/votes.rs diff --git a/youmubot/src/commands/fun/mod.rs b/youmubot/src/commands/fun/mod.rs index 1d68806..7e80a3d 100644 --- a/youmubot/src/commands/fun/mod.rs +++ b/youmubot/src/commands/fun/mod.rs @@ -14,17 +14,15 @@ use serenity::{ mod images; mod names; -mod votes; use images::*; -use votes::VOTE_COMMAND; group!({ name: "fun", options: { description: "Random commands", }, - commands: [roll, pick, name, vote, image, nsfw], + commands: [roll, pick, name, image, nsfw], }); #[command] diff --git a/youmubot/src/commands/mod.rs b/youmubot/src/commands/mod.rs index e14bd5f..b323cbb 100644 --- a/youmubot/src/commands/mod.rs +++ b/youmubot/src/commands/mod.rs @@ -10,9 +10,11 @@ use std::collections::HashSet; mod args; pub mod admin; +pub mod community; pub mod fun; pub use admin::ADMIN_GROUP; +pub use community::COMMUNITY_GROUP; pub use fun::FUN_GROUP; // A help command diff --git a/youmubot/src/main.rs b/youmubot/src/main.rs index 70f8ac6..b122331 100644 --- a/youmubot/src/main.rs +++ b/youmubot/src/main.rs @@ -115,9 +115,13 @@ fn setup_framework(mut client: Client) -> Client { c.delay(120 /* 2 minutes */).time_span(120).limit(1) }) .bucket("images", |c| c.time_span(60).limit(2)) + .bucket("community", |c| { + c.delay(30).time_span(30).limit(1) + }) // groups here .group(&commands::ADMIN_GROUP) - .group(&commands::FUN_GROUP), + .group(&commands::FUN_GROUP) + .group(&commands::COMMUNITY_GROUP), ); client }