mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-03 00:41:27 +03:00
progress
This commit is contained in:
@@ -177,7 +177,9 @@ module.exports = class Command {
|
||||
data: {
|
||||
type: 4,
|
||||
flags: flags(secret),
|
||||
content
|
||||
data: {
|
||||
content
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -140,7 +140,7 @@ module.exports = class CommandManager {
|
||||
/**
|
||||
* Execute a command
|
||||
* @param {string} cmd_name - Name of the command
|
||||
* @param {interaction} interaction - Command interaction
|
||||
* @param {Interaction} interaction - Command interaction
|
||||
*/
|
||||
async execute(cmd_name, interaction) {
|
||||
if (!this.commands.has(cmd_name))
|
||||
@@ -157,6 +157,11 @@ module.exports = class CommandManager {
|
||||
|
||||
const cmd = this.commands.get(cmd_name);
|
||||
|
||||
let settings = await data.guild.settings;
|
||||
if (!settings)
|
||||
settings = await data.guild.createSettings();
|
||||
const i18n = this.client.i18n.get(settings.locale);
|
||||
|
||||
// if (cmd.staff_only) {
|
||||
// return await cmd.sendResponse(interaction, msg, true);
|
||||
// }
|
||||
@@ -165,7 +170,7 @@ module.exports = class CommandManager {
|
||||
&& !data.member.hasPermission(cmd.permissions);
|
||||
if (no_perm) {
|
||||
let perms = cmd.permissions.map(p => `\`${p}\``).join(', ');
|
||||
let msg = `❌ You do not have the permissions required to use this command:\n${perms}`;
|
||||
let msg = i18n('no_perm', perms);
|
||||
return await cmd.sendResponse(interaction, msg, true);
|
||||
}
|
||||
|
||||
|
10
src/modules/structures.js
Normal file
10
src/modules/structures.js
Normal file
@@ -0,0 +1,10 @@
|
||||
const fs = require('fs');
|
||||
const { path } = require('../utils/fs');
|
||||
|
||||
module.exports = () => {
|
||||
const files = fs.readdirSync(path('./src/structures'))
|
||||
.filter(file => file.endsWith('.js'));
|
||||
|
||||
for (const file of files)
|
||||
require(`../structures/${file}`);
|
||||
};
|
Reference in New Issue
Block a user