Melaine Gérard
1248460946
Some checks failed
Retrieve Events Datas / Retrieve-Events-Datas (push) Failing after 13s
19 lines
561 B
JavaScript
19 lines
561 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);
|
|
|
|
if (!Array.isArray(datas)) return;
|
|
|
|
writeFileSync("events.json", JSON.stringify(datas, null, 4));
|
|
})() |