Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
fix(GuildCreateListener): fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazmi35 committed Feb 20, 2024
1 parent 3ee6826 commit c63ca62
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export class GuildCreateListener extends Listener {
let ops = [];
for (const role of payload.data.d.roles) {
if (ops.length >= 500 || ops.length > 0) {
const SQLs = ops.map(q => q.sql.replaceAll(/\$(?<index>\d+)/gu, (match, groups) => {
let value = q.params[Number(groups.index) - 1];
const SQLs = ops.map(q => q.sql.replaceAll(/\$(?<index>\d+)/gu, (match, index) => {
let value = q.params[Number(index) - 1];

// If the value is a string, wrap it in quotes
if (typeof value === "string") {
Expand Down Expand Up @@ -149,8 +149,8 @@ export class GuildCreateListener extends Listener {
for (const member of payload.data.d.members) {
if (member.user !== undefined) {
if (ops.length >= 500 || ops.length > 0) {
const SQLs = ops.map(q => q.sql.replaceAll(/\$(?<index>\d+)/gu, (match, groups) => {
let value = q.params[Number(groups.index) - 1];
const SQLs = ops.map(q => q.sql.replaceAll(/\$(?<index>\d+)/gu, (match, index) => {
let value = q.params[Number(index) - 1];

// If the value is a string, wrap it in quotes
if (typeof value === "string") {
Expand Down Expand Up @@ -198,8 +198,8 @@ export class GuildCreateListener extends Listener {
for (const member of payload.data.d.members) {
if (member.user !== undefined) {
if (ops.length >= 500 || ops.length > 0) {
const SQLs = ops.map(q => q.sql.replaceAll(/\$(?<index>\d+)/gu, (match, groups) => {
let value = q.params[Number(groups.index) - 1];
const SQLs = ops.map(q => q.sql.replaceAll(/\$(?<index>\d+)/gu, (match, index) => {
let value = q.params[Number(index) - 1];

// If the value is a string, wrap it in quotes
if (typeof value === "string") {
Expand Down Expand Up @@ -260,8 +260,8 @@ export class GuildCreateListener extends Listener {

for (const channel of payload.data.d.channels) {
if (ops.length >= 500 || ops.length > 0) {
const SQLs = ops.map(q => q.sql.replaceAll(/\$(?<index>\d+)/gu, (match, groups) => {
let value = q.params[Number(groups.index) - 1];
const SQLs = ops.map(q => q.sql.replaceAll(/\$(?<index>\d+)/gu, (match, index) => {
let value = q.params[Number(index) - 1];

// If the value is a string, wrap it in quotes
if (typeof value === "string") {
Expand Down Expand Up @@ -308,8 +308,8 @@ export class GuildCreateListener extends Listener {
if (voice.channel_id === null) continue;

if (ops.length >= 500 || ops.length > 0) {
const SQLs = ops.map(q => q.sql.replaceAll(/\$(?<index>\d+)/gu, (match, groups) => {
let value = q.params[Number(groups.index) - 1];
const SQLs = ops.map(q => q.sql.replaceAll(/\$(?<index>\d+)/gu, (match, index) => {
let value = q.params[Number(index) - 1];

// If the value is a string, wrap it in quotes
if (typeof value === "string") {
Expand Down

0 comments on commit c63ca62

Please sign in to comment.