spacecommands 3.6.2 → 3.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -144,7 +144,23 @@ class ReactionHandler {
|
|
|
144
144
|
if (names.length && typeof names !== 'string') {
|
|
145
145
|
desc += `\n${instance.messageHandler.getEmbed(guild, 'HELP_MENU', 'ALIASES')}: "${names.join('", "')}"`;
|
|
146
146
|
}
|
|
147
|
-
desc += `\n${instance.messageHandler.getEmbed(guild, 'HELP_MENU'
|
|
147
|
+
desc += `\n${instance.messageHandler.getEmbed(guild, 'HELP_MENU')}: "${instance.getPrefix(guild)}${mainName}${syntax ? ' ' : ''}${syntax || ''}"`;
|
|
148
|
+
if (guild) {
|
|
149
|
+
const requiredRoles = command.getRequiredRoles(guild.id);
|
|
150
|
+
if (requiredRoles && requiredRoles.length) {
|
|
151
|
+
const roleNames = [];
|
|
152
|
+
for (const roleId of requiredRoles) {
|
|
153
|
+
const role = guild.roles.cache.get(roleId);
|
|
154
|
+
if (role) {
|
|
155
|
+
roleNames.push(role.name);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
roleNames.push(roleId);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
desc += `\nRequired Roles: ${roleNames.join(', ')}`;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
148
164
|
return desc;
|
|
149
165
|
};
|
|
150
166
|
/**
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
const required_roles_1 = __importDefault(require("../models/required-roles"));
|
|
6
|
+
const commands_1 = __importDefault(require("../models/commands"));
|
|
6
7
|
module.exports = {
|
|
7
8
|
description: 'Specifies what role each command requires.',
|
|
8
9
|
category: 'Configuration',
|
|
@@ -32,11 +33,10 @@ module.exports = {
|
|
|
32
33
|
autocomplete: async (interaction, instance) => {
|
|
33
34
|
const focusedOption = interaction.options.getFocused(true);
|
|
34
35
|
if (focusedOption.name === 'command') {
|
|
35
|
-
const commandsModel = require('../models/commands').default;
|
|
36
36
|
// Fetch all commands (optimisation: maybe cache this?)
|
|
37
37
|
let commands = [];
|
|
38
38
|
try {
|
|
39
|
-
commands = await
|
|
39
|
+
commands = await commands_1.default.find();
|
|
40
40
|
}
|
|
41
41
|
catch (e) {
|
|
42
42
|
console.warn('SpaceCommands > Failed to fetch commands for autocomplete:', e);
|