17 lines
521 B
JavaScript
17 lines
521 B
JavaScript
|
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);
|
||
|
|
||
|
writeFileSync("events.json", JSON.stringify(datas, null, 4));
|
||
|
})()
|