From 57ca04288b2de049e06ac02ff78315dccce4ea72 Mon Sep 17 00:00:00 2001 From: Isaac Date: Tue, 16 Mar 2021 11:16:08 +0000 Subject: [PATCH] Localisation changes Locale is global not per guild --- src/commands/new.js | 14 +++++++------- src/database/index.js | 6 +----- user/example.config.js | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/commands/new.js b/src/commands/new.js index 4f86e38..6c8fa20 100644 --- a/src/commands/new.js +++ b/src/commands/new.js @@ -4,18 +4,18 @@ const Command = require('../modules/commands/command'); module.exports = class NewCommand extends Command { constructor(client) { - const i18n = client.i18n.get(); + const i18n = client.i18n.get(client.config.locale); super(client, { internal: true, name: i18n('commands.new.name'), description: i18n('commands.new.description'), options: [ - // { - // name: i18n('commands.new.options.category.name'), - // type: OptionTypes.STRING, - // description: i18n('commands.new.options.topic.description'), - // required: true, - // }, + { + name: i18n('commands.new.options.category.name'), + type: OptionTypes.STRING, + description: i18n('commands.new.options.topic.description'), + required: true, + }, { name: i18n('commands.new.options.topic.name'), type: OptionTypes.STRING, diff --git a/src/database/index.js b/src/database/index.js index 40fe228..4de53ea 100644 --- a/src/database/index.js +++ b/src/database/index.js @@ -57,7 +57,7 @@ module.exports = async (log) => { await sequelize.authenticate(); log.success('Connected to database successfully'); } catch (error) { - log.warn('Unable to connect to database'); + log.warn('Failed to connect to database'); log.error(error); return process.exit(); } @@ -72,10 +72,6 @@ module.exports = async (log) => { type: DataTypes.STRING, defaultValue: config.defaults.colour }, - locale: { - type: DataTypes.STRING, - defaultValue: config.defaults.locale - }, log_messages: { type: DataTypes.BOOLEAN, defaultValue: config.defaults.log_messages diff --git a/user/example.config.js b/user/example.config.js index f4bc5f1..4da4c2a 100644 --- a/user/example.config.js +++ b/user/example.config.js @@ -26,11 +26,11 @@ module.exports = { debug: false, defaults: { colour: '#009999', - locale: 'en-GB', // can **not** be set for each server log_messages: true, // transcripts/archives will be empty if false prefix: '-', ticket_welcome: 'Hello {{name}}, thank you for creating a ticket. A member of staff will soon be available to assist you.\n\n__All messages in this channel are stored for future reference.__', }, + locale: 'en-GB', logs: { enabled: true, keep_for: 30