mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2025-02-22 09:44:37 +00:00
minecraft: forgot to include permissions import on whitelist command
Some checks failed
Docker / build (push) Has been cancelled
Some checks failed
Docker / build (push) Has been cancelled
This commit is contained in:
parent
647d57fe82
commit
0ddaf4caea
1 changed files with 12 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
||||||
const { SlashCommandBuilder } = require("discord.js");
|
const { SlashCommandBuilder, PermissionsBitField } = require("discord.js");
|
||||||
const { Rcon } = require("rcon-client");
|
const { Rcon } = require("rcon-client");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -14,21 +14,21 @@ module.exports = {
|
||||||
isModOnly: true,
|
isModOnly: true,
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute(interaction) {
|
||||||
const username = interaction.options.getString("username");
|
// Check if the user has the Manage Server permission
|
||||||
await interaction.deferReply();
|
|
||||||
|
|
||||||
try {
|
|
||||||
// committee only for now, remove once opened to public
|
|
||||||
if (
|
if (
|
||||||
!interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)
|
!interaction.member.permissions.has(PermissionsBitField.Flags.ManageGuild)
|
||||||
) {
|
) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: "You do not have permission to use this command!",
|
content: "You do not have permission to use this command!",
|
||||||
ephemeral: true,
|
ephemeral: false,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const username = interaction.options.getString("username");
|
||||||
|
await interaction.deferReply();
|
||||||
|
|
||||||
|
try {
|
||||||
const rcon = new Rcon({
|
const rcon = new Rcon({
|
||||||
host: process.env.RCON_HOST,
|
host: process.env.RCON_HOST,
|
||||||
port: Number(process.env.RCON_PORT),
|
port: Number(process.env.RCON_PORT),
|
||||||
|
|
Loading…
Reference in a new issue