@elara-services/tickets 4.4.0 → 4.4.2
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/lib/base.js +4 -2
- package/lib/util.js +1 -1
- package/package.json +2 -2
package/lib/base.js
CHANGED
|
@@ -26,7 +26,10 @@ module.exports = class Tickets {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
this.options = options;
|
|
29
|
-
this.rest = new REST(
|
|
29
|
+
this.rest = new REST();
|
|
30
|
+
if ("setToken" in this.rest && options.client.token) {
|
|
31
|
+
this.rest.setToken(options.client.token);
|
|
32
|
+
}
|
|
30
33
|
if (options.suppressPatreon !== true) {
|
|
31
34
|
emitPackageMessage(`${name} - thanks`, () => {
|
|
32
35
|
log(`[${name}, v${version}]: Thanks for using the package!`, `Please support the packages via ${funding.map((c) => c.url).join(" OR ")}`);
|
|
@@ -311,7 +314,6 @@ module.exports = class Tickets {
|
|
|
311
314
|
if (!options) {
|
|
312
315
|
throw new Error(`No options provided`);
|
|
313
316
|
}
|
|
314
|
-
|
|
315
317
|
if (hasBit(options.flags, 1 << 15)) {
|
|
316
318
|
return await this.rest
|
|
317
319
|
.post(Routes.channelMessages(channelId), {
|
package/lib/util.js
CHANGED
|
@@ -346,7 +346,7 @@ exports.embed = (content, { color, title, guild, footer, author, str, descriptio
|
|
|
346
346
|
|
|
347
347
|
exports.webhook = (options) => {
|
|
348
348
|
const { id, token, username, avatar, threadId } = options;
|
|
349
|
-
return new Webhook(`https://discord.com/api/
|
|
349
|
+
return new Webhook(`https://discord.com/api/webhooks/${id}/${token}`, {
|
|
350
350
|
username,
|
|
351
351
|
avatar_url: avatar,
|
|
352
352
|
threadId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elara-services/tickets",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.2",
|
|
4
4
|
"description": "Helper for tickets",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@discordjs/rest": "^2.5.0",
|
|
31
31
|
"@elara-services/packages": "^7.0.6",
|
|
32
32
|
"@elara-services/utils": "^3.0.7",
|
|
33
|
-
"@elara-services/webhooks": "^4.1.
|
|
33
|
+
"@elara-services/webhooks": "^4.1.1",
|
|
34
34
|
"discord-api-types": "^0.38.8"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|