mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-11-10 01:08:07 +01:00
fix: dont use copilooooooooooooot - correct guildid
This commit is contained in:
parent
14b0c6d252
commit
6c1528b7be
1 changed files with 3 additions and 3 deletions
|
@ -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}`,
|
||||
|
|
Loading…
Reference in a new issue