minecraft: forgot to include permissions import on whitelist command
Some checks failed
Docker / build (push) Has been cancelled

This commit is contained in:
Ayden Jahola 2025-02-18 13:46:35 +00:00
parent 647d57fe82
commit 0ddaf4caea
No known key found for this signature in database
GPG key ID: 71DD90AE4AE92742

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js");
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
const { Rcon } = require("rcon-client");
module.exports = {
@ -14,21 +14,21 @@ module.exports = {
isModOnly: true,
async execute(interaction) {
// Check if the user has the Manage Server permission
if (
!interaction.member.permissions.has(PermissionsBitField.Flags.ManageGuild)
) {
await interaction.reply({
content: "You do not have permission to use this command!",
ephemeral: false,
});
return;
}
const username = interaction.options.getString("username");
await interaction.deferReply();
try {
// committee only for now, remove once opened to public
if (
!interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)
) {
await interaction.reply({
content: "You do not have permission to use this command!",
ephemeral: true,
});
return;
}
const rcon = new Rcon({
host: process.env.RCON_HOST,
port: Number(process.env.RCON_PORT),