mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-11-22 14:41:05 +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) {
|
while (true) {
|
||||||
const members: any[] = await (await fetch(
|
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: {
|
headers: {
|
||||||
Authorization: `Bot ${token}`,
|
Authorization: `Bot ${token}`,
|
||||||
|
@ -14,7 +14,7 @@ export const getDiscordGuildMembers = async(token: string) => {
|
||||||
}
|
}
|
||||||
)).json();
|
)).json();
|
||||||
|
|
||||||
if (!members.length) break;
|
if (members.length == 0) break;
|
||||||
|
|
||||||
result.push(...members.map(m => ({ id: m.id, nickname: m.nick })));
|
result.push(...members.map(m => ({ id: m.id, nickname: m.nick })));
|
||||||
oldId = members[members.length - 1].id;
|
oldId = members[members.length - 1].id;
|
||||||
|
@ -31,7 +31,7 @@ export const removeExclamationFromNicknames = async(token: string) => {
|
||||||
for (const member of await getDiscordGuildMembers(token)) {
|
for (const member of await getDiscordGuildMembers(token)) {
|
||||||
if (!member.nickname?.startsWith?.('!')) continue;
|
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',
|
method: 'PATCH',
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bot ${token}`,
|
Authorization: `Bot ${token}`,
|
||||||
|
|
Loading…
Reference in a new issue