Skip to content

Commit

Permalink
chore: add global flag to regex
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewL246 committed Aug 5, 2024
1 parent cd2acbb commit 4ba40b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/commands/ban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function banHandler(interaction: ChatInputCommandInteraction): Promise<voi
const users = interaction.options.getString('users', true);
const reason = interaction.options.getString('reason', true);

const userIds = [...new Set(Array.from(users!.matchAll(new RegExp(/\d{17,18}/, 'g')), match => match[0]))];
const userIds = [...new Set(Array.from(users!.matchAll(new RegExp(/\d{17,18}/g)), match => match[0]))];

const bansListEmbed = new EmbedBuilder();
bansListEmbed.setTitle('User Bans :thumbsdown:');
Expand Down
2 changes: 1 addition & 1 deletion src/commands/kick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function kickHandler(interaction: ChatInputCommandInteraction): Promise<vo
const users = interaction.options.getString('users', true);
const reason = interaction.options.getString('reason', true);

const userIds = [...new Set(Array.from(users.matchAll(new RegExp(/\d{17,18}/, 'g')), match => match[0]))];
const userIds = [...new Set(Array.from(users.matchAll(new RegExp(/\d{17,18}/g)), match => match[0]))];

const kicksListEmbed = new EmbedBuilder();
kicksListEmbed.setTitle('User Kicks :thumbsdown:');
Expand Down
2 changes: 1 addition & 1 deletion src/commands/warn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function warnHandler(interaction: ChatInputCommandInteraction): Promise<vo
const users = interaction.options.getString('users', true);
const reason = interaction.options.getString('reason', true);

const userIds = [...new Set(Array.from(users.matchAll(new RegExp(/\d{17,18}/, 'g')), match => match[0]))];
const userIds = [...new Set(Array.from(users.matchAll(new RegExp(/\d{17,18}/g)), match => match[0]))];

const warningListEmbed = new EmbedBuilder();
warningListEmbed.setTitle('User Warnings :thumbsdown:');
Expand Down

0 comments on commit 4ba40b4

Please sign in to comment.