mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-06 18:21:25 +03:00
Add message and ticket referencing, fixes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const { MessageCommand } = require('@eartharoid/dbf');
|
||||
const { useGuild } = require('../../lib/tickets/utils');
|
||||
|
||||
module.exports = class CreateMessageCommand extends MessageCommand {
|
||||
constructor(client, options) {
|
||||
@@ -13,7 +14,11 @@ module.exports = class CreateMessageCommand extends MessageCommand {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("discord.js").MessageContextMenuCommandInteraction} interaction
|
||||
*/
|
||||
async run(interaction) {
|
||||
// TODO: archive message
|
||||
await useGuild(this.client, interaction, { referencesMessage: interaction.targetMessage.channelId + '/' + interaction.targetId });
|
||||
}
|
||||
};
|
@@ -1,5 +1,6 @@
|
||||
const { SlashCommand } = require('@eartharoid/dbf');
|
||||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { useGuild } = require('../../lib/tickets/utils');
|
||||
|
||||
module.exports = class NewSlashCommand extends SlashCommand {
|
||||
constructor(client, options) {
|
||||
@@ -14,7 +15,7 @@ module.exports = class NewSlashCommand extends SlashCommand {
|
||||
autocomplete: true,
|
||||
name: 'references',
|
||||
required: false,
|
||||
type: ApplicationCommandOptionType.Integer,
|
||||
type: ApplicationCommandOptionType.String,
|
||||
},
|
||||
];
|
||||
opts = opts.map(o => {
|
||||
@@ -43,5 +44,12 @@ module.exports = class NewSlashCommand extends SlashCommand {
|
||||
});
|
||||
}
|
||||
|
||||
async run(interaction) { }
|
||||
/**
|
||||
*
|
||||
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
||||
*/
|
||||
async run(interaction) {
|
||||
await useGuild(this.client, interaction, { referencesTicketId: interaction.options.getString('references', false) });
|
||||
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user