From 7cf29040ce081881639156c63601e41d71ec7427 Mon Sep 17 00:00:00 2001 From: Isaac Date: Mon, 22 Feb 2021 23:40:16 +0000 Subject: [PATCH] things --- src/modules/commands/command.js | 2 +- src/modules/tickets/index.js | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/modules/commands/command.js b/src/modules/commands/command.js index 7d9564c..d13b701 100644 --- a/src/modules/commands/command.js +++ b/src/modules/commands/command.js @@ -174,7 +174,7 @@ module.exports = class Command { * @param {boolean} secret - Ephemeral message? **NOTE: EMBEDS AND ATTACHMENTS DO NOT RENDER IF TRUE** */ async sendResponse(interaction, content, secret) { - const send = this.client.api.interactions(interaction.id, interaction.token).messages['@original'].patch; + const send = this.client.api.webhooks(this.client.fetchApplication().id, interaction.token).messages['@original'].patch; if (typeof content === 'object') send({ data: { diff --git a/src/modules/tickets/index.js b/src/modules/tickets/index.js index 9946a15..1b60851 100644 --- a/src/modules/tickets/index.js +++ b/src/modules/tickets/index.js @@ -3,7 +3,7 @@ const EventEmitter = require('events'); const { Client } = require('discord.js'); /** Manages tickets */ -module.exports = class extends EventEmitter { +module.exports = class TicketManager extends EventEmitter { /** * Create a TicketManager instance * @param {Client} client @@ -19,8 +19,36 @@ module.exports = class extends EventEmitter { /** * Create a new ticket + * @param {string} guild - ID of the guild to create the ticket in + * @param {string} creator - ID of the ticket creator (user) + * @param {string} category - ID of the ticket category + * @param {string} [topic] - The ticket topic */ - async create() { + async create(guild, creator, category, topic) { + + } + + /** + * Get a ticket + * @param {string} ticket - The channel ID, or the ticket number + */ + async get(ticket) { + + } + + /** + * Close a ticket + * @param {string} ticket - The channel ID, or the ticket number + */ + async close(ticket) { + + } + + /** + * Close multiple tickets + * @param {string[]} tickets - An array of channel IDs to close **(does not accept ticket numbers)** + */ + async closeMultiple(tickets) { } }; \ No newline at end of file