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
// Grab user ID and then prep invocation if User-visible info provided
20
25
varinvocation=current.text
21
26
.replace(/^!(?:un)?verify-admin\u0020?/gi,"")
22
27
.trim();
23
28
varparamArr=invocation.split(" ");
24
29
25
-
if(paramArr.length==0){
30
+
// 1. Handle -help flag
31
+
if(paramArr.length==1&¶mArr[0]=="-help"){
26
32
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`";
33
+
"*Admin Tool - Verify User*\n"+
34
+
"A parser for setting user verification and descriptions. \n"+
35
+
"*Note:* This parser can only be triggered from admin channels.\n\n"+
"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";
56
+
"!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`";
57
+
slacker.send_chat(current,messageBody,true);
58
+
return;// Stop execution
33
59
}
34
60
35
-
if(/^<@.*?>$/.test(paramArr[0])){
36
-
messageBody=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