@elara-services/tickets 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,6 +11,7 @@ const { Client } = require("discord.js"),
11
11
  tickets = new Tickets({
12
12
  client,
13
13
  prefix: "support", // This is what is used for interactions (buttons) and the start of the channel name
14
+ ticketCategory: "", // When tickets get created they get created in this category, (OPTIONAL) - Default is the category ID for the starter message's channel.
14
15
  webhookId: "WEBHOOK ID HERE",
15
16
  webhookToken: "WEBHOOK TOKEN HERE",
16
17
  encryptToken: "ASB!@#$%^&*(B", // This is to encrypt/decrypt the user IDs in the channel topic, to avoid non-staff from seeing who's ticket it is
package/index.d.ts CHANGED
@@ -7,6 +7,8 @@ declare module "@elara-services/tickets" {
7
7
  client: Client;
8
8
  prefix: string;
9
9
  encryptToken: string;
10
+ ticketCategory?: string;
11
+
10
12
  webhookId?: string;
11
13
  webhookToken?: string;
12
14
  webhookUsername?: string;
package/index.js CHANGED
@@ -102,7 +102,7 @@ module.exports = class Tickets {
102
102
  async run(int) {
103
103
  if (int?.isButton?.()) {
104
104
  let { guild, channel, member, customId } = int,
105
- category = guild?.channels?.resolve?.(channel?.parentId),
105
+ category = guild?.channels?.resolve?.(this.options.ticketCategory || channel?.parentId),
106
106
  [ support, supportUsers ] = [ [], [] ];
107
107
  if (!guild || !guild.available || !channel || !member || !category) return;
108
108
  if (this.options?.supportRoleIds?.length) for (const sup of this.options.supportRoleIds) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elara-services/tickets",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Helper for tickets",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/renovate.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": [
3
+ "config:base"
4
+ ]
5
+ }