1 const https = require("https")
2 const Discord = require("discord.js")
4 const url = "https://content.minetest.net/api/packages/Wuzzy/mineclone2/"
5 const channelID = "831215776446676994"
7 const client = new Discord.Client({ intents: [Discord.GatewayIntentBits.Guilds] })
9 const update = chan => fetch(url)
10 .then(res => res.json())
11 .then(data => chan.setName(`🔽 ${data.downloads} Downloads`))
13 client.on("ready", _ => client.channels.fetch(channelID)
15 .then(chan => setInterval(update, 5 * 60 * 1000, chan)))
17 client.login(process.env.DISCORD_TOKEN)