diff options
| author | Fuwn <[email protected]> | 2020-11-04 18:31:17 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2020-11-04 18:31:17 -0800 |
| commit | 5379c1cc497dad9b686120e60de0e0d77352602e (patch) | |
| tree | 1757342f89264063ac546b9e5e553c9a97990fe6 /src | |
| parent | feat, fix, chore, revert (desc) (diff) | |
| download | dep-core-next-5379c1cc497dad9b686120e60de0e0d77352602e.tar.xz dep-core-next-5379c1cc497dad9b686120e60de0e0d77352602e.zip | |
fix: parse for mentions not just @everyone
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/commands/admins/config.rs | 8 | ||||
| -rw-r--r-- | src/modules/commands/general/fun.rs | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/commands/admins/config.rs b/src/modules/commands/admins/config.rs index 926da7b..eedd087 100644 --- a/src/modules/commands/admins/config.rs +++ b/src/modules/commands/admins/config.rs @@ -80,8 +80,8 @@ impl Command for ConfigPrefix { } fn execute(&self, _: &mut Context, message: &Message, mut args: Args) -> Result<(), CommandError> { - if message.content.to_lowercase().contains("@everyone") { - message.channel_id.say("Sorry, but the prefix can't mention everyone.")?; + if !message.mentions.is_empty() { + message.channel_id.say("Sorry, but the prefix can't mention people.")?; return Ok(()); } @@ -459,8 +459,8 @@ impl Command for ConfigWelcome { } fn execute(&self, _: &mut Context, message: &Message, mut args: Args) -> Result<(), CommandError> { - if message.content.to_lowercase().contains("@everyone") { - message.channel_id.say("Try again, my welcome greeting can't mention everyone.")?; + if !message.mentions.is_empty() { + message.channel_id.say("Try again, my welcome greeting can't be initialized when it mentions someone!.")?; return Ok(()); } diff --git a/src/modules/commands/general/fun.rs b/src/modules/commands/general/fun.rs index 55880b3..31deeeb 100644 --- a/src/modules/commands/general/fun.rs +++ b/src/modules/commands/general/fun.rs @@ -29,8 +29,8 @@ impl Command for Clapify { } fn execute(&self, _: &mut Context, message: &Message, args: Args) -> Result<(), CommandError> { - if message.content.to_lowercase().contains("@everyone") { - message.channel_id.say("I refuse to clap everyone!")?; + if !message.mentions.is_empty() { + message.channel_id.say("Sorry, but I can only clapify non-human things!")?; return Ok(()); } @@ -190,7 +190,7 @@ impl Command for Opinion { } fn execute(&self, _ctx: &mut Context, message: &Message, args: Args) -> Result<(), CommandError> { - if message.content.to_lowercase().contains("@everyone") { + if message.mentions.len() > 1 { message.channel_id.say("I can't give my opinion on everyone all at once!")?; return Ok(()); } @@ -222,7 +222,7 @@ impl Command for Rate { } fn execute(&self, _ctx: &mut Context, message: &Message, args: Args) -> Result<(), CommandError> { - if message.content.to_lowercase().contains("@everyone") { + if message.mentions.len() > 1 { message.channel_id.say("I can't rate everyone at once!")?; return Ok(()); } @@ -273,8 +273,8 @@ impl Command for Uwufy { } fn execute(&self, _: &mut Context, message: &Message, args: Args) -> Result<(), CommandError> { - if message.content.to_lowercase().contains("@everyone") { - message.channel_id.say("I seriously doubt everyone will be interested in \"uwufying\" something...")?; + if !message.mentions.is_empty() { + message.channel_id.say("Try again, but next time, don't tag anyone please.")?; return Ok(()); } |