Polarcraft/discordbot/commands/nuke.js

22 lines
598 B
JavaScript
Raw Normal View History

2023-08-17 10:23:15 +02:00
const { SlashCommandBuilder } = require('discord.js');
const { simpleEmbed } = require('../functions/embeds.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('nuke')
.setDescription('Put the server in maintenance mode')
.setDefaultMemberPermissions(0),
async execute(interaction) {
await fetch(process.env.MINECRAFT_HOST + '/console', {
method: 'POST',
headers: {
'content-type': 'text/plain',
},
body: 'maintenance on',
});
await interaction.reply({ embeds: [simpleEmbed('Nuked server!')], ephemeral: true });
},
};