mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-03 00:41:27 +03:00
Update i18n (and fix commands)
This commit is contained in:
@@ -128,7 +128,7 @@ module.exports = class Command {
|
||||
if (!cmd_name) cmd_name = this.name;
|
||||
|
||||
const prefix = settings.command_prefix;
|
||||
const i18n = this.client.i18n.get(settings.locale);
|
||||
const i18n = this.client.i18n.getLocale(settings.locale);
|
||||
|
||||
const addArgs = (embed, arg) => {
|
||||
let required = arg.required ? '`❗` ' : '';
|
||||
|
@@ -61,6 +61,9 @@ module.exports = class CommandManager {
|
||||
* @param {Message} message - Command message
|
||||
*/
|
||||
async handle(message) {
|
||||
let settings = await message.guild.settings;
|
||||
const i18n = this.client.i18n.getLocale(settings.locale);
|
||||
|
||||
let is_blacklisted = false;
|
||||
if (settings.blacklist.includes(message.author.id)) {
|
||||
is_blacklisted = true;
|
||||
@@ -82,10 +85,6 @@ module.exports = class CommandManager {
|
||||
}
|
||||
}
|
||||
|
||||
let settings = await message.guild.settings;
|
||||
|
||||
const i18n = this.client.i18n.get(settings.locale);
|
||||
|
||||
const prefix = settings.command_prefix;
|
||||
const escaped_prefix = prefix.toLowerCase().replace(/(?=\W)/g, '\\'); // (lazy) escape every character so it can be used in a RexExp
|
||||
const client_mention = `<@!?${this.client.user.id}>`;
|
||||
|
@@ -30,7 +30,7 @@ module.exports = class TicketManager extends EventEmitter {
|
||||
|
||||
let guild = this.client.guilds.cache.get(cat_row.guild);
|
||||
let settings = await guild.settings;
|
||||
const i18n = this.client.i18n.get(settings.locale);
|
||||
const i18n = this.client.i18n.getLocale(settings.locale);
|
||||
let member = guild.members.cache.get(t_row.creator);
|
||||
let t_channel = this.client.channels.cache.get(t_row.id);
|
||||
|
||||
@@ -218,7 +218,7 @@ module.exports = class TicketManager extends EventEmitter {
|
||||
|
||||
let guild = this.client.guilds.cache.get(t_row.guild);
|
||||
let settings = await guild.settings;
|
||||
const i18n = this.client.i18n.get(settings.locale);
|
||||
const i18n = this.client.i18n.getLocale(settings.locale);
|
||||
let channel = await this.client.channels.fetch(t_row.channel);
|
||||
|
||||
if (closer_id) {
|
||||
|
Reference in New Issue
Block a user