Prechádzať zdrojové kódy

Fix self-mute check

ghorsington 4 rokov pred
rodič
commit
2400e1ef43
1 zmenil súbory, kde vykonal 5 pridanie a 5 odobranie
  1. 5 5
      bot/src/plugins/violation.ts

+ 5 - 5
bot/src/plugins/violation.ts

@@ -344,11 +344,6 @@ export class ViolationPlugin {
             return { ok: false };
         }
 
-        if (userId == message.author.id) {
-            await message.reply(`cannot ${command} yourself!`);
-            return { ok: false };
-        }
-
         const user = await this.resolveUser(userId);
 
         if (!user) {
@@ -357,6 +352,11 @@ export class ViolationPlugin {
             return { ok: false };
         }
 
+        if (user.id == message.author.id) {
+            await message.reply(`cannot ${command} yourself!`);
+            return { ok: false };
+        }
+
         if (user.id == client.botUser.id) {
             await message.reply(`cannot apply ${command} on me!`);
             return { ok: false };