fix: dont use copilooooooooooooot - correct guildid

This commit is contained in:
xHyroM 2022-10-20 12:47:20 +02:00
parent 14b0c6d252
commit 6c1528b7be

View file

@ -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}`,