funny-irc-bot/commands/dcstatus.js

16 lines
494 B
JavaScript
Raw Normal View History

2025-08-12 18:39:05 +02:00
module.exports = {
data: {
"name": 'dcstatus',
"usage": '',
"description": 'Check if Discord is working.'
},
async execute(event, bot) {
const response = await fetch('https://discordstatus.com/api/v2/status.json');
if (!response.ok) {
event.reply("Failed to download status!")
} else {
const json = await response.json()
event.reply(`${json.status.description}: ${json.page.url}`)
}
}
}