{"_id":"@aquarius-bot/regex","_rev":"1-d5d4ef399254a466320a7403816c07ea","name":"@aquarius-bot/regex","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@aquarius-bot/regex","version":"0.0.1","description":"Regex matchers for Discord","author":{"name":"Ian Mitchell","email":"ian.mitchel1@live.com"},"homepage":"https://github.com/ianmitchell/aquarius","repository":{"type":"git","url":"git+ssh://git@github.com/ianmitchell/aquarius.git","directory":"packages/regex"},"publishConfig":{"access":"public"},"license":"MIT","keywords":["discord","discord.js","bot","node","aquarius"],"main":"./regex.js","type":"module","rollup":{"skip":true},"gitHead":"92dcf8ee9a7b7acd10d209796d3a65c996e30e1d","bugs":{"url":"https://github.com/ianmitchell/aquarius/issues"},"_id":"@aquarius-bot/regex@0.0.1","_nodeVersion":"13.7.0","_npmVersion":"lerna/3.20.2/node@v13.7.0+x64 (darwin)","dist":{"integrity":"sha512-vAFV9s6CtCPrsgj7TIT74evXtMaaMnPeISQK12JiT0dgxOlJFMS0AkGogBVrVR6mUYq0Pr5noS09F77Fu7FN3g==","shasum":"b4b15ee9a0a414d44a17a9e4c97483ed506863c4","tarball":"https://registry.npmjs.org/@aquarius-bot/regex/-/regex-0.0.1.tgz","fileCount":5,"unpackedSize":11049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJengAHCRA9TVsSAnZWagAAF5gP/iAjn5TwWtCd7GsvAlVB\nL7RuVTBP+GBMJjIOeTnTZILP0+UTEnjuTDjFbbPYl/I29JZbGPfM75rsEyoB\nJHdPE3CEk4DIDkdl+i7pVjLsDqHLD1QyIkSqPjw3dSpzZz97S0zCPV7TZFFM\nkH24WL4aaoaqWQ0GcfZouLIoZMTQeg02xGEJu0aSiZv/POgjpQ2SVT7Fq77N\n9Ya03iaMdAa82cypymEY8WKGJ8YVHuFbLGg3GubkMI/TJhYOu5FAkTp5Usza\nIc5RB9MUdDuqvStOdCXYvCzR1K4NohNtT2vdRn+ao5gYSq90UpBybO3WEyMF\nWShhiSCkWsZCgZKx946/0y2sJvMikkAzmwAlM2y2g5I87pvCLQ46JhBoiJq0\nqyuBnq/IY41iKMY4DZn1kidqrkRxQ9G9UYCKqx14SyOpc34uESgAz2SZ7ay5\n+1801OwdE91MkJhMlJ7YVFeYQ23NPFMo7LL6R41lZh5tg3N7PSIsuwJr185T\ng+z3Isida2whpcgSNwwKnlD95bol076iDW0z6lCCTk52l93VB8AYVLQdqyHT\nD0kcsTn0YcnpWsdercT5iPshu4EWrwdtvhhvTFk0xBZEstalhqTJ+nfBvVCC\nBBJWaCtg/TjZhuM+r4G9pLN0nUQZ/tj+2Qot2Ujqw9nHo5ssm990YFrt3mSF\nZuBo\r\n=mJ2e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFNKMTTGt94r72TCi/QkPGOWGKjmrtEbQAY4wmRQLpygIgJ9Yv4waHmu7U21eBCxBv6/yankIp9+AJW3MCjvTQWD8="}]},"maintainers":[{"name":"ianmitchell","email":"ian.mitchel1@live.com"}],"_npmUser":{"name":"ianmitchell","email":"ian.mitchel1@live.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regex_0.0.1_1587412999017_0.7835030791663422"},"_hasShrinkwrap":false}},"time":{"created":"2020-04-20T20:03:18.226Z","0.0.1":"2020-04-20T20:03:19.201Z","modified":"2022-04-04T15:13:56.235Z"},"maintainers":[{"name":"ianmitchell","email":"ian.mitchel1@live.com"}],"description":"Regex matchers for Discord","homepage":"https://github.com/ianmitchell/aquarius","keywords":["discord","discord.js","bot","node","aquarius"],"repository":{"type":"git","url":"git+ssh://git@github.com/ianmitchell/aquarius.git","directory":"packages/regex"},"author":{"name":"Ian Mitchell","email":"ian.mitchel1@live.com"},"bugs":{"url":"https://github.com/ianmitchell/aquarius/issues"},"license":"MIT","readme":"# @aquarius-bot/regex\n\nRegex helpers for matching with Discord message structures.\n\n## Available Patterns\n\n- MENTION\n- MENTION_USER\n- MENTION_USER_ID\n- MENTION_USER_NICKNAME\n- MENTION_CHANNEL\n- MENTION_ROLE\n- EMOJI\n- CUSTOM_EMOJI\n- ANIMATED_EMOJI\n- BRACKET (matches [[Card]] syntax)\n\n## Available Helpers\n\nThis package also includes some additional helpers when working with mentions. If you're trying to determine what kind of mention a references is, you can call `getMentionType` with the message to return the type of mention. The options are defined in the `MENTION_TYPES` enum.\n\nFor instance, given a list of mentions you might use the following to map them to actual objects:\n\n```javascript\nmentions.map((mention) => {\n  switch (getMentionType(mention[0])) {\n    case MENTION_TYPES.USER:\n      return message.guild.members.fetch(mention.groups.id);\n    case MENTION_TYPES.CHANNEL:\n      return message.guild.channels.cache.get(mention.groups.id);\n    case MENTION_TYPES.ROLE:\n      return message.guild.roles.fetch(mention.groups.id);\n    default:\n      return null;\n  }\n});\n```\n\n## Combining Patterns\n\nSay you want to match a message that looks like this -\n\n```\nAssign @user @role\n```\n\nYou would could combine the patterns like this:\n\n```javascript\nimport { MENTION_USER, MENTION_ROLE } from '@aquarius-bot/regex';\n\nconst pattern = new RegExp(\n  `Assign ${MENTION_USER.source} ${MENTION_ROLE.source}`\n);\n```\n","readmeFilename":"README.md"}