feat: #206 convert to interactions (buttons and application commands) (#238)

* feat: make command handler slash command-ready

Only `help` and `settings` commands work so far

* feat(commands): finish new settings command

* fix(settings): convert `roles` and `ping` to an array

* fix(commands): make `add` a slash command

* fix(commands): make `blacklist` a slash command

* fix(commands): remove URLs from `help` command

* Add weblate badge and overview image

* Update sponsors

* sqlite things

* imrpovements

* update eslint rules

* (⚠ untested) close command

* fix: default locale for getting command option names

* Update README.md

* Update README.md

* Update README.md

* update new command to slash commands and fix close command

* fixes and improvements

* fix: closing a ticket when the creator has left

* Revert "fix: closing a ticket when the creator has left"

This reverts commit afc40ae17077782e344fd8cee03a089966c2347e.

* fix: closing a ticket when the creator has left

* fix: localisation issues in settings command

* fix: delete category channel

* New button and select panels + updated message panels

Includes new options for panel embed message image and thumbnail

Co-Authored-By: Puneet Gopinath <baalkrshna@gmail.com>
Co-Authored-By: thevisuales <6569806+thevisuales@users.noreply.github.com>

* Finish converting to buttons, added close button

Co-Authored-By: Puneet Gopinath <baalkrshna@gmail.com>
Co-Authored-By: thevisuales <6569806+thevisuales@users.noreply.github.com>

* fully convert to slash commands

* re-add "... has created a ticket" message

* locales

* fix add and remove commands

* fix remove command

* fix stats command

* eslint

Co-authored-by: Puneet Gopinath <baalkrshna@gmail.com>
Co-authored-by: thevisuales <6569806+thevisuales@users.noreply.github.com>
This commit is contained in:
Isaac
2021-09-24 15:32:36 +01:00
committed by GitHub
parent 39e2cef38d
commit 95f76716ed
38 changed files with 2481 additions and 2268 deletions

View File

@@ -39,7 +39,8 @@ module.exports = async client => {
logging: text => client.log.debug(text),
storage: path('./user/database.sqlite')
});
client.log.warn('SQLite is not sufficient for a production environment if you want to use ticket archives. You should disable "log_messages" in your servers\' settings or use a different database.');
client.config.defaults.log_messages = false;
client.log.warn('Message logging is disabled due to insufficient database');
} else {
client.log.info(`Connecting to ${types[type].name} database...`);
sequelize = new Sequelize(DB_NAME, DB_USER, DB_PASS, {
@@ -66,7 +67,7 @@ module.exports = async client => {
require(`./models/${model}`)(client, sequelize);
}
await sequelize.sync({ alter: { drop: false } });
await sequelize.sync({ alter: true });
return sequelize;
};

View File

@@ -86,5 +86,8 @@ module.exports = ({ config }, sequelize) => {
allowNull: true,
type: DataTypes.STRING
}
}, { tableName: DB_TABLE_PREFIX + 'categories' });
}, {
paranoid: true,
tableName: DB_TABLE_PREFIX + 'categories'
});
};

View File

@@ -3,7 +3,10 @@ module.exports = ({ config }, sequelize) => {
const { DB_TABLE_PREFIX } = process.env;
sequelize.define('Guild', {
blacklist: {
defaultValue: [],
defaultValue: {
members: [],
roles: []
},
get() {
const raw_value = this.getDataValue('blacklist');
return raw_value
@@ -14,14 +17,14 @@ module.exports = ({ config }, sequelize) => {
},
type: DataTypes.JSON
},
close_button: {
defaultValue: false,
type: DataTypes.BOOLEAN
},
colour: {
defaultValue: config.defaults.colour,
type: DataTypes.STRING
},
command_prefix: {
defaultValue: config.defaults.command_prefix,
type: DataTypes.STRING
},
error_colour: {
defaultValue: 'RED',
type: DataTypes.STRING

View File

@@ -2,17 +2,9 @@ const { DataTypes } = require('sequelize');
module.exports = (client, sequelize) => {
const { DB_TABLE_PREFIX } = process.env;
sequelize.define('Panel', {
categories: {
allowNull: false,
get() {
const raw_value = this.getDataValue('categories');
return raw_value
? typeof raw_value === 'string'
? JSON.parse(raw_value)
: raw_value
: null;
},
type: DataTypes.JSON
category: {
allowNull: true,
type: DataTypes.CHAR(19)
},
channel: {
allowNull: false,
@@ -25,10 +17,6 @@ module.exports = (client, sequelize) => {
model: DB_TABLE_PREFIX + 'guilds'
},
type: DataTypes.CHAR(19)
},
message: {
allowNull: false,
type: DataTypes.CHAR(19)
}
}, { tableName: DB_TABLE_PREFIX + 'panels' });
};