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

@@ -1,8 +1,6 @@
const {
Guild, // eslint-disable-line no-unused-vars
GuildMember // eslint-disable-line no-unused-vars
} = require('discord.js');
const { GuildMember } = require('discord.js'); // eslint-disable-line no-unused-vars
const { Model } = require('sequelize'); // eslint-disable-line no-unused-vars
const config = require('../../user/config');
let current_presence = -1;
@@ -33,12 +31,12 @@ module.exports = class DiscordUtils {
}
/**
* get a guild's settings
* @param {Guild} guild - The Guild
* Fet a guild's settings
* @param {string} id - The guild's ID
* @returns {Promise<Model>}
*/
async getSettings(guild) {
const data = { id: guild.id };
async getSettings(id) {
const data = { id };
const [settings] = await this.client.db.models.Guild.findOrCreate({
defaults: data,
where: data
@@ -48,11 +46,11 @@ module.exports = class DiscordUtils {
/**
* Delete a guild's settings
* @param {Guild} guild - The Guild
* @param {string} id - The guild ID
* @returns {Promise<Number>}
*/
async deleteSettings(guild) {
const row = await this.getSettings(guild);
async deleteSettings(id) {
const row = await this.getSettings(id);
return await row.destroy();
}