Skip to content

Commit ce1d645

Browse files
authored
verify admin - fix userid population (#496)
1 parent 4c36e2c commit ce1d645

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Parsers/Admin tool - Verify.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,16 @@ if (
3232
"Admin Tool - Verify user\nA parser for setting user verification and descriptions. *Note:* This parser can only be triggered from admin channels specified.\n\nUsage: `!verify-admin @username [-v|-unv] [message]`\nExamples:\n`!verify-admin @Astrid -unv Is an Impasta`\n`!verify-admin @Astrid Some Role, Some Company`\n`!verify-admin @Astrid -v`\n\nSupported flags:\n-v: Verify the user\n-unv: Remove verification from user\n-help: Show this message";
3333
}
3434

35-
if (paramArr.length >= 2) {
3635
if (/^<@.*?>$/.test(paramArr[0])) {
36+
messageBody = paramArr[0];
3737
userId = paramArr[0].replace(/[<>@]/g, "");
3838
paramArr.shift();
3939
} else {
4040
messageBody =
4141
"!verify-admin must be called with a user tag, followed by an optional parameter and optional description. For example: `!verify-admin @Astrid -unv Is an Impasta`\n\nThe full list of accepted triggers can be found by sending `!verify-admin -help`";
42-
slacker.send_chat(current, messageBody, true);
42+
slacker.send_chat(current, messageBody, true);
4343
}
44-
}
45-
44+
4645
if (paramArr.indexOf("-v") > -1 && paramArr.indexOf("-unv") > -1) {
4746
messageBody =
4847
"Please only provide one verify parameter in your message. Verification message ignored.";
@@ -77,8 +76,7 @@ if (
7776
"\n";
7877
messageBody += "User information:\n>" + description;
7978
} else {
80-
messageBody +=
81-
`I'm afraid I can't do that as the ~limit~ user (<@${userId}>) does not exist.`;
79+
messageBody += `I'm afraid I can't do that as the ~limit~ user (<@${userId}>) does not exist.`;
8280
}
8381
slacker.send_chat(current, messageBody, true);
8482
}

0 commit comments

Comments
 (0)