Skip to content

Commit 86130b1

Browse files
authored
verify admin - add unverify option (#493)
1 parent bfc9218 commit 86130b1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Parsers/Admin tool - Verify.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
activation_example:!verify-admin @Astrid, !verify-admin -help
3-
regex:^!verify-admin\u0020?
3+
regex:^!(?:un)?verify-admin\u0020?
44
flags:gi
55
*/
66

@@ -12,7 +12,7 @@ if (current.channel == 'GD51HTR46' || current.channel == 'G9LAJG7G8' || current.
1212
var slacker = new x_snc_slackerbot.Slacker();
1313

1414
// Grab user ID and then prep invocation if User-visible info provided
15-
var invocation = current.text.replace(/^!verify-admin\u0020?/gi,'').trim();
15+
var invocation = current.text.replace(/^!(?:un)?verify-admin\u0020?/gi,'').trim();
1616
var paramArr = invocation.split(' ');
1717

1818
if(paramArr.length == 0){
@@ -42,7 +42,10 @@ if (current.channel == 'GD51HTR46' || current.channel == 'G9LAJG7G8' || current.
4242
messageBody = 'Please only provide one verify parameter in your message. Verification message ignored.';
4343
slacker.send_chat(current, messageBody, true);
4444
} else {
45-
if(paramArr.indexOf('-v') > -1){
45+
if(/^!unverify/.test(current.text)){
46+
verificationStatus = false;
47+
}
48+
else if(paramArr.indexOf('-v') > -1){
4649
verificationStatus = true;
4750
}
4851

0 commit comments

Comments
 (0)