Skip to content

Instantly share code, notes, and snippets.

@HKGx
Created August 21, 2019 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HKGx/180cdd1aacf6f78c2b5a060a78efe565 to your computer and use it in GitHub Desktop.
Save HKGx/180cdd1aacf6f78c2b5a060a78efe565 to your computer and use it in GitHub Desktop.
function getUserFromMentionRegExWithLengthCheck(mention) {
const matches = mention.match(/^<@!?(\d{18})>$/);
if (!matches) return;
const id = matches[1];
return users.get(id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment