Settings command, many small changes, improvements, and fixes

This commit is contained in:
Isaac
2021-03-23 23:32:24 +00:00
parent e6fa1d067f
commit ffc415354a
9 changed files with 182 additions and 45 deletions

View File

@@ -5,7 +5,6 @@ const {
const { path } = require('../utils/fs');
const config = require('../../user/config');
const types = require('./dialects');
const supported = Object.keys(types);
module.exports = async (log) => {
@@ -21,6 +20,7 @@ module.exports = async (log) => {
let type = (DB_TYPE || 'sqlite').toLowerCase();
const supported = Object.keys(types);
if (!supported.includes(type)) {
log.error(new Error(`DB_TYPE (${type}) is not a valid type`));
return process.exit();
@@ -68,10 +68,22 @@ module.exports = async (log) => {
primaryKey: true,
allowNull: false,
},
locale: {
type: DataTypes.STRING,
defaultValue: config.locale
},
colour: {
type: DataTypes.STRING,
defaultValue: config.defaults.colour
},
success_colour: {
type: DataTypes.STRING,
defaultValue: 'GREEN'
},
error_colour: {
type: DataTypes.STRING,
defaultValue: 'RED'
},
log_messages: {
type: DataTypes.BOOLEAN,
defaultValue: config.defaults.log_messages
@@ -100,6 +112,9 @@ module.exports = async (log) => {
},
unique: 'name_guild'
},
roles: {
type: DataTypes.JSON
}
}, {
tableName: DB_TABLE_PREFIX + 'categories'
});