Skip to content

Rework !verify-admin to allow single call for both toggle and description #328

Closed

Description

@SapphicFire

The current implementation of !verify-admin is unwieldy and requires two calls to verify a user and set their description. Lets take the difficulty out of that

if(invocation.length == 0){
verification_status = !(grUser.getValue('verified') == 1 ? true : false); // Get verified and toggle
grUser.setValue('verified',verification_status);
message_body += 'Updated <@' + user_id + '>\'s verification status. They are now ' + (verification_status ? 'verified.' : 'unverified. To add a user-visible note instead of toggling verification, add text after `!verify-admin @User `. Example: `!verify-admin @Astrid Is upside down`');
} else {
grUser.setValue('user_info', invocation);
grUser.update();
message_body += 'Updated <@' + user_id + '>\'s user info message.';
}

Possible approaches:

  • Toggle on each call
    • This falls over if we just want to change someone's role
  • Use flag (i.e. !verify-admin -v Message)
  • Use a flag or other indicator and contain Message in quotation marks
  • ... I'm not going to give you all the ideas :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions