@elara-services/tickets 4.3.2 → 4.3.4

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/index.js CHANGED
@@ -1,4 +1,3 @@
1
- const { emitPackageMessage, log } = require("@elara-services/utils");
2
1
  const pack = require("./package.json");
3
2
  const { version } = require("discord.js");
4
3
 
@@ -8,9 +7,6 @@ module.exports = (() => {
8
7
  }
9
8
  let [major] = version.split(".");
10
9
  if (["13", "14"].includes(major)) {
11
- emitPackageMessage(`${pack.name} - thanks`, () => {
12
- log(`[${pack.name}, v${pack.version}]: Thanks for using the package!`, `Please support the packages via ${pack.funding.map((c) => c.url).join(" OR ")}`);
13
- });
14
10
  return require(`./lib/v${major}`);
15
11
  }
16
12
  throw new Error(`[${pack.name}, v${pack.version}]: The discord.js version you're using isn't supported by this package. (currently supported: v13, v14)`);
package/lib/base.js CHANGED
@@ -3,14 +3,12 @@ const {
3
3
  Interactions: { button },
4
4
  ButtonStyle,
5
5
  } = require("@elara-services/packages");
6
- const { is, status, isV13, embedComment, log } = require("@elara-services/utils");
6
+ const { is, status, isV13, embedComment, log, emitPackageMessage } = require("@elara-services/utils");
7
7
  const { WebhookClient } = require("discord.js");
8
8
  const { name, version, funding } = require("../package.json");
9
9
  const required = ["client", "prefix", "encryptToken"];
10
10
  const moment = require("moment");
11
11
 
12
- let showed = false;
13
-
14
12
  module.exports = class Tickets {
15
13
  /**
16
14
  * @param {import("@elara-services/tickets").TicketOptions} options
@@ -25,9 +23,10 @@ module.exports = class Tickets {
25
23
  }
26
24
  }
27
25
  this.options = options;
28
- if (!showed && options.suppressPatreon !== true) {
29
- log(`[${name}, ${version}]: Thanks for using the package, if you want to support the packages created: ${funding.map((c) => c.url).join(" or ")}`);
30
- showed = true;
26
+ if (options.suppressPatreon !== true) {
27
+ emitPackageMessage(`${name} - thanks`, () => {
28
+ log(`[${name}, v${version}]: Thanks for using the package!`, `Please support the packages via ${funding.map((c) => c.url).join(" OR ")}`);
29
+ });
31
30
  }
32
31
  }
33
32
 
package/lib/util.js CHANGED
@@ -323,9 +323,9 @@ exports.hasTicket = ({ userId, guild, token, prefix } = {}) => {
323
323
  return guild.channels.cache.filter((c) => [0, "GUILD_TEXT"].includes(c.type) && c.topic && exports.code(c.topic.split("ID: ")[1], "d", token) === userId && c.name?.match?.(new RegExp(prefix, "gi"))).size ? true : false;
324
324
  };
325
325
 
326
- exports.embed = (content, { color, title, guild, footer, author, str } = {}) => ({
326
+ exports.embed = (content, { color, title, guild, footer, author, str, description } = {}) => ({
327
327
  title: title || str("INFO"),
328
- description: content,
328
+ description: content || description,
329
329
  color: color || 0xff0000,
330
330
  timestamp: new Date(),
331
331
  footer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elara-services/tickets",
3
- "version": "4.3.2",
3
+ "version": "4.3.4",
4
4
  "description": "Helper for tickets",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",