Commit ff0eb455 authored by spookydonut's avatar spookydonut

better way of doing random nickname

parent 2790347c
Pipeline #178 canceled with stages
......@@ -40,6 +40,15 @@ pub fn new_member(ctx: &Context, mut new_member: Member) {
};
}
pub const RANDOM_NICKNAMES: &[&str] = &[
"The Big Cheese",
"The One and Only",
"The Exalted One",
"not to be trusted",
"The Scoundrel",
"A big fish in a small pond",
];
pub struct Commands;
impl Commands {
pub fn register(ctx: Context, msg: Message, account_name: &str) {
......@@ -74,18 +83,10 @@ impl Commands {
e!(
"Unable to edit nickname: {:?}",
member.edit(&ctx.http, |m| {
let mut rng = rand::thread_rng();
m.nickname(format!(
"{}, {}",
name,
[
"The Big Cheese",
"The One and Only",
"The Exalted One",
"not to be trusted",
"The Scoundrel",
"A big fish in a small pond",
][rng.gen_range(0, 5)]
RANDOM_NICKNAMES.choose(&mut rand::thread_rng())
));
m
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment