diff --git a/dist/discord.js b/dist/discord.js index 501b79c..9fce2b6 100644 --- a/dist/discord.js +++ b/dist/discord.js @@ -7,13 +7,12 @@ const v9_1 = require("discord-api-types/v9"); const commands = [ { name: 'queue', - description: 'create a queue', + description: 'get queue info or initialize a queue for this channel', options: [ { type: 4, name: 'teamsize', description: 'size of each team', - required: true, min_value: 1 } ] @@ -27,12 +26,8 @@ const commands = [ description: 'leave the active queue' }, { - name: 'ready', - description: 'ready the queue and display team info' - }, - { - name: 'cancel', - description: 'cancels the current queue (must have the Manage Messages permission)' + name: 'stop', + description: 'stops the current queue (must have the Manage Messages permission)' }, { name: 'player', diff --git a/dist/util.js b/dist/util.js index 6c15f05..6c1c30e 100644 --- a/dist/util.js +++ b/dist/util.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getChannel = exports.getMember = exports.emsg = exports.errorMessage = exports.shuffle = void 0; +exports.memberIsModThrow = exports.memberIsMod = exports.getChannel = exports.getMember = exports.emsg = exports.errorMessage = exports.shuffle = void 0; const discord_js_1 = require("discord.js"); /** * shuffles an array @@ -64,3 +64,13 @@ function getChannel(interaction) { return channel; } exports.getChannel = getChannel; +function memberIsMod(interaction) { + let member = getMember(interaction); + return member.permissionsIn(interaction.channelId).has('MANAGE_MESSAGES'); +} +exports.memberIsMod = memberIsMod; +function memberIsModThrow(interaction) { + if (!memberIsMod(interaction)) + throw (0, exports.emsg)('Member is not a moderator'); +} +exports.memberIsModThrow = memberIsModThrow;