mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-19 16:58:55 +00:00
Core: put role over message in choose
This commit is contained in:
parent
e830eab3f2
commit
53f6286d3d
1 changed files with 2 additions and 2 deletions
|
@ -31,17 +31,17 @@ struct Community;
|
||||||
#[command]
|
#[command]
|
||||||
#[description = r"👑 Randomly choose an active member and mention them!
|
#[description = r"👑 Randomly choose an active member and mention them!
|
||||||
Note that only online/idle users in the channel are chosen from."]
|
Note that only online/idle users in the channel are chosen from."]
|
||||||
#[usage = "[title = the chosen one] / [limited roles = everyone online]"]
|
#[usage = "[limited roles = everyone online] / [title = the chosen one]"]
|
||||||
#[example = "the strongest in Gensokyo"]
|
#[example = "the strongest in Gensokyo"]
|
||||||
#[bucket = "community"]
|
#[bucket = "community"]
|
||||||
#[max_args(2)]
|
#[max_args(2)]
|
||||||
pub async fn choose(ctx: &Context, m: &Message, mut args: Args) -> CommandResult {
|
pub async fn choose(ctx: &Context, m: &Message, mut args: Args) -> CommandResult {
|
||||||
|
let role = args.find::<RoleId>().ok();
|
||||||
let title = if args.is_empty() {
|
let title = if args.is_empty() {
|
||||||
"the chosen one".to_owned()
|
"the chosen one".to_owned()
|
||||||
} else {
|
} else {
|
||||||
args.single::<String>()?
|
args.single::<String>()?
|
||||||
};
|
};
|
||||||
let role = args.single::<RoleId>().ok();
|
|
||||||
|
|
||||||
let users: Result<Vec<_>, Error> = {
|
let users: Result<Vec<_>, Error> = {
|
||||||
let guild = m.guild(&ctx).await.unwrap();
|
let guild = m.guild(&ctx).await.unwrap();
|
||||||
|
|
Loading…
Add table
Reference in a new issue