You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
messageBody='!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`';
20
-
}
19
+
// Grab user ID and then prep invocation if User-visible info provided
20
+
varinvocation=current.text
21
+
.replace(/^!(?:un)?verify-admin\u0020?/gi,"")
22
+
.trim();
23
+
varparamArr=invocation.split(" ");
21
24
22
-
if(paramArr.length==1&¶mArr[0]=='-help'){
23
-
messageBody='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';
24
-
}
25
+
if(paramArr.length==0){
26
+
messageBody=
27
+
"!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`";
28
+
}
25
29
26
-
if(paramArr.length>=2){
27
-
if(/^<@.*?>$/.test(paramArr[0])){
28
-
userId=paramArr[0].replace(/[<>@]/g,'');
29
-
paramArr.shift();
30
-
}else{
31
-
messageBody='!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`';
32
-
}
33
-
}
34
-
35
-
if(messageBody.length>0||userId.length==0){
36
-
if(messageBody.length==0&&userId.length==0){
37
-
messageBody='The provided user details are malformed, meaning the user cannot be verified.';
messageBody='Please only provide one verify parameter in your message. Verification message ignored.';
43
-
slacker.send_chat(current,messageBody,true);
44
-
}else{
45
-
if(/^!unverify/.test(current.text)){
46
-
verificationStatus=false;
47
-
}
48
-
elseif(paramArr.indexOf('-v')>-1){
49
-
verificationStatus=true;
50
-
}
30
+
if(paramArr.length==1&¶mArr[0]=="-help"){
31
+
messageBody=
32
+
"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";
33
+
}
51
34
52
-
elseif(paramArr.indexOf('-unv')>-1){
53
-
verificationStatus=false;
54
-
}
35
+
if(paramArr.length>=2){
36
+
if(/^<@.*?>$/.test(paramArr[0])){
37
+
userId=paramArr[0].replace(/[<>@]/g,"");
38
+
paramArr.shift();
39
+
}else{
40
+
messageBody=
41
+
"!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`";
0 commit comments