invite
invite(link: string): {
include: boolean,
matchs: RegExpMatchArray | null,
groups: Array<{ code: string } | null> | null
}
Search user mention in a string:
const { discord } = require('regex-simplify');
const invite = discord.invite(`
https://discord.gg/7prqAjux
https://discord.com/invite/7prqAjux
discord.gg/7prqAjux
https://discord.com/7prqAjux
`);
console.log(invite);
{
include: true,
matchs: [
'discord.gg/7prqAjux',
'discord.com/invite/7prqAjux',
'discord.gg/7prqAjux'
],
groups: [
[Object: null prototype] { code: '7prqAjux' },
[Object: null prototype] { code: '7prqAjux' },
[Object: null prototype] { code: '7prqAjux' }
]
}
Last updated