Base for community

This commit is contained in:
Natsu Kagami 2019-12-09 15:38:44 -05:00
parent 333d6d8baa
commit 068fdc8974
5 changed files with 21 additions and 4 deletions

View file

@ -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],
});

View file

@ -14,17 +14,15 @@ use serenity::{
mod images; mod images;
mod names; mod names;
mod votes;
use images::*; use images::*;
use votes::VOTE_COMMAND;
group!({ group!({
name: "fun", name: "fun",
options: { options: {
description: "Random commands", description: "Random commands",
}, },
commands: [roll, pick, name, vote, image, nsfw], commands: [roll, pick, name, image, nsfw],
}); });
#[command] #[command]

View file

@ -10,9 +10,11 @@ use std::collections::HashSet;
mod args; mod args;
pub mod admin; pub mod admin;
pub mod community;
pub mod fun; pub mod fun;
pub use admin::ADMIN_GROUP; pub use admin::ADMIN_GROUP;
pub use community::COMMUNITY_GROUP;
pub use fun::FUN_GROUP; pub use fun::FUN_GROUP;
// A help command // A help command

View file

@ -115,9 +115,13 @@ fn setup_framework(mut client: Client) -> Client {
c.delay(120 /* 2 minutes */).time_span(120).limit(1) c.delay(120 /* 2 minutes */).time_span(120).limit(1)
}) })
.bucket("images", |c| c.time_span(60).limit(2)) .bucket("images", |c| c.time_span(60).limit(2))
.bucket("community", |c| {
c.delay(30).time_span(30).limit(1)
})
// groups here // groups here
.group(&commands::ADMIN_GROUP) .group(&commands::ADMIN_GROUP)
.group(&commands::FUN_GROUP), .group(&commands::FUN_GROUP)
.group(&commands::COMMUNITY_GROUP),
); );
client client
} }