Polarcraft/discordbot/commands/nuke.js
Xeovalyte 5f0de3f326
All checks were successful
Build and Publish / Build and Publish Discord Bot (push) Successful in 28s
Build and Publish / Build and Publish Minecraft Mod (push) Successful in 2m17s
Added nuke command
2023-08-17 10:23:42 +02:00

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 });
},
};