const {config} = require('dotenv'); const {writeFileSync} = require("node:fs"); config(); (async () => { let datas = await fetch("https://discord.com/api/v10/guilds/" + process.env.DISCORD_GUILD_ID + "/scheduled-events?with_user_count=true", { method: "GET", headers: { "Authorization": "Bot " + process.env.DISCORD_BOT_TOKEN, } }) .then(response => response.json()) .then(data => data); if (!Array.isArray(datas)) return; writeFileSync("events.json", JSON.stringify(datas, null, 4)); })()