diff options
| author | Fuwn <[email protected]> | 2020-11-04 20:42:40 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2020-11-04 20:42:40 -0800 |
| commit | ed4bf9cb63576c89cad9179d9de3e0e2dd67a8ea (patch) | |
| tree | 9883d6cfbe7f9f0e5708e0b0cfc3b9fcac096549 /src/modules/commands/admins | |
| parent | fix: parse for mentions not just @everyone (diff) | |
| download | dep-core-next-ed4bf9cb63576c89cad9179d9de3e0e2dd67a8ea.tar.xz dep-core-next-ed4bf9cb63576c89cad9179d9de3e0e2dd67a8ea.zip | |
fix: mention handling where it should be handled
Diffstat (limited to 'src/modules/commands/admins')
| -rw-r--r-- | src/modules/commands/admins/config.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/commands/admins/config.rs b/src/modules/commands/admins/config.rs index eedd087..c3a0252 100644 --- a/src/modules/commands/admins/config.rs +++ b/src/modules/commands/admins/config.rs @@ -80,9 +80,9 @@ impl Command for ConfigPrefix { } fn execute(&self, _: &mut Context, message: &Message, mut args: Args) -> Result<(), CommandError> { - if !message.mentions.is_empty() { - message.channel_id.say("Sorry, but the prefix can't mention people.")?; - return Ok(()); + if check_mentions(message) { + message.channel_id.say(MENTION_FAIL)?; + return Ok(()) } if let Some(guild_id) = message.guild_id { @@ -91,10 +91,10 @@ impl Command for ConfigPrefix { guild_data.prefix = pre; match db.update_guild(guild_id.0 as i64, guild_data) { Ok(guild) => { - message.channel_id.say(format!("Set prefix to {}", guild.prefix))?; + message.channel_id.say(format!("Set guild prefix to `{}`.", guild.prefix))?; }, Err(_) => { - message.channel_id.say("Failed to change prefix")?; + message.channel_id.say("Unexpected error while changing prefix.")?; }, } } else { @@ -249,7 +249,7 @@ impl Command for ConfigMod { fn options(&self) -> Arc<CommandOptions> { let default = CommandOptions::default(); let options = CommandOptions { - desc: Some("Welcome to moderation!".to_string()), + desc: Some("Configure the moderation log, superstitious much.".to_string()), usage: Some("<add|remove> <role_resolvable>".to_string()), example: Some("add staff".to_string()), min_args: Some(2), @@ -459,9 +459,9 @@ impl Command for ConfigWelcome { } fn execute(&self, _: &mut Context, message: &Message, mut args: Args) -> Result<(), CommandError> { - if !message.mentions.is_empty() { - message.channel_id.say("Try again, my welcome greeting can't be initialized when it mentions someone!.")?; - return Ok(()); + if check_mentions(message) { + message.channel_id.say(MENTION_FAIL)?; + return Ok(()) } if let Some(guild_id) = message.guild_id { |