From 6c1528b7beb500c58093aaf139356226c958ec5a Mon Sep 17 00:00:00 2001 From: xHyroM Date: Thu, 20 Oct 2022 12:47:20 +0200 Subject: [PATCH] fix: dont use copilooooooooooooot - correct guildid --- src/utils/discord.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/discord.ts b/src/utils/discord.ts index 091b1ef..f706088 100644 --- a/src/utils/discord.ts +++ b/src/utils/discord.ts @@ -6,7 +6,7 @@ export const getDiscordGuildMembers = async(token: string) => { while (true) { const members: any[] = await (await fetch( - `https://discord.com/api/v8/guilds/${process.env.DISCORD_GUILD_ID}/members?limit=1000${oldId ? `&after=${oldId}` : ''}`, + `https://discord.com/api/v10/guilds/876711213126520882/members?limit=1000${oldId ? `&after=${oldId}` : ''}`, { headers: { Authorization: `Bot ${token}`, @@ -14,7 +14,7 @@ export const getDiscordGuildMembers = async(token: string) => { } )).json(); - if (!members.length) break; + if (members.length == 0) break; result.push(...members.map(m => ({ id: m.id, nickname: m.nick }))); oldId = members[members.length - 1].id; @@ -31,7 +31,7 @@ export const removeExclamationFromNicknames = async(token: string) => { for (const member of await getDiscordGuildMembers(token)) { if (!member.nickname?.startsWith?.('!')) continue; - await fetch(`https://discord.com/api/v8/guilds/${process.env.DISCORD_GUILD_ID}/members/${member.id}`, { + await fetch(`https://discord.com/api/v8/guilds/876711213126520882/members/${member.id}`, { method: 'PATCH', headers: { Authorization: `Bot ${token}`,