Skip to content

Commit

Permalink
fix: fixed parsing roles to allowed mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Aug 25, 2024
1 parent 54e3586 commit 3c09aae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/api/SendWebhookMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ const roleMatcherRegex = /<@&(\d{17,20})>/g;
function extractRoles(text: string): string[] {
const matches = text.matchAll(roleMatcherRegex);

return [...matches].map((match) => match.groups?.id).filter(Boolean) as string[];
return [...matches].map((match) => match.at(1)).filter(Boolean) as string[];
}

0 comments on commit 3c09aae

Please sign in to comment.