22 lines
598 B
JavaScript
22 lines
598 B
JavaScript
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 });
|
|
},
|
|
};
|