Add message and ticket referencing, fixes

This commit is contained in:
Isaac
2022-08-13 23:01:44 +01:00
parent f6666b103e
commit c64b18a397
10 changed files with 262 additions and 38 deletions

View File

@@ -1,4 +1,5 @@
const { Menu } = require('@eartharoid/dbf');
const { MessageFlags } = require('discord.js');
module.exports = class CreateMenu extends Menu {
constructor(client, options) {
@@ -13,11 +14,11 @@ module.exports = class CreateMenu extends Menu {
* @param {import("discord.js").SelectMenuInteraction} interaction
*/
async run(id, interaction) {
interaction.message.edit({ components: interaction.message.components }); // reset the select menu (minor client-side UI issue)
if (!interaction.message.flags.has(MessageFlags.Ephemeral)) interaction.message.edit({ components: interaction.message.components }); // reset the select menu (minor client-side UI issue)
await this.client.tickets.create({
...id,
categoryId: interaction.values[0],
interaction,
topic: id.topic,
});
}
};