For the complete documentation index, see llms.txt. This page is also available as Markdown.

👑roleMention

roleMention(role: string): { 
    include: boolean, 
    matchs: RegExpMatchArray | null, 
    groups: Array<{ id: string } | null> | null
}

Search role mention in a string:

const { discord } = require('regex-simplify');

const role = discord.roleMention(`
    <@&783057923076653136>
    <@&830426254977138688>
    <@&830426294890004490>
`);

console.log(role);
{
  include: true,
  matchs: [
    '<@&783057923076653136>',
    '<@&830426254977138688>',
    '<@&830426294890004490>'
  ],
  groups: [
    [Object: null prototype] { id: '783057923076653136' },
    [Object: null prototype] { id: '830426254977138688' },
    [Object: null prototype] { id: '830426294890004490' } 
  ]
}

Last updated