mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-19 16:58:55 +00:00
Base for community
This commit is contained in:
parent
333d6d8baa
commit
068fdc8974
5 changed files with 21 additions and 4 deletions
13
youmubot/src/commands/community/mod.rs
Normal file
13
youmubot/src/commands/community/mod.rs
Normal 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],
|
||||||
|
});
|
|
@ -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]
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue