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

#️⃣channelMention

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

Search channel mention in a string:

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

const channel = discord.channelMention(`
    <#584749055578603521>
    <#720256732630351912>
    <#507329636305207308>
`);

console.log(channel);
{
  include: true,
  matchs: [
    '<#584749055578603521>',
    '<#720256732630351912>',
    '<#507329636305207308>'
  ],
  groups: [
    [Object: null prototype] { id: '584749055578603521' },
    [Object: null prototype] { id: '720256732630351912' },
    [Object: null prototype] { id: '507329636305207308' }
  ]
}

Last updated