@fluxerjs/core 1.0.7 → 1.0.9
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/dist/{Channel-OSOB6ELO.mjs → Channel-ICWNKXBR.mjs} +1 -1
- package/dist/{ClientUser-RNDKHQ3Z.mjs → ClientUser-WWXUMO5O.mjs} +1 -2
- package/dist/{Guild-GOQZ7XP4.mjs → Guild-TM6YGJWB.mjs} +3 -1
- package/dist/GuildBan-M4PA3HAA.mjs +7 -0
- package/dist/{GuildMember-BJJNCL6W.mjs → GuildMember-RZWZ3OCG.mjs} +1 -2
- package/dist/{Webhook-AG6QFM2I.mjs → Invite-UM5BU5A6.mjs} +3 -3
- package/dist/{Message-QXPHQOVC.mjs → Message-6IYEYSV6.mjs} +1 -2
- package/dist/MessageReaction-XRPYZDSC.mjs +7 -0
- package/dist/{Webhook-NUQCJAWZ.mjs → Role-SVLWIAMN.mjs} +3 -3
- package/dist/{Webhook-2RHBXH7R.mjs → Webhook-32VJD4AL.mjs} +1 -1
- package/dist/{chunk-T2NSVWBH.mjs → chunk-53Y37KRG.mjs} +35 -1
- package/dist/chunk-DSPSRPHF.mjs +200 -0
- package/dist/{chunk-WYSHH4LR.mjs → chunk-FJS5FBXO.mjs} +98 -6
- package/dist/{chunk-J3EIGOXQ.mjs → chunk-GCIJYVRC.mjs} +20 -6
- package/dist/{chunk-NISGA2YZ.mjs → chunk-GFUJVQ7L.mjs} +13 -4
- package/dist/chunk-HBF5QEDH.mjs +42 -0
- package/dist/chunk-QEXIYXXU.mjs +62 -0
- package/dist/chunk-RCP27MRC.mjs +33 -0
- package/dist/chunk-SQVCCSNN.mjs +41 -0
- package/dist/chunk-X77DFNE3.mjs +136 -0
- package/dist/index.d.mts +520 -55
- package/dist/index.d.ts +520 -55
- package/dist/index.js +1333 -404
- package/dist/index.mjs +616 -189
- package/package.json +27 -8
- package/dist/Channel-2WNJ445K.mjs +0 -17
- package/dist/Channel-BEZOW4VC.mjs +0 -17
- package/dist/Channel-DPLLHL7Y.mjs +0 -19
- package/dist/Channel-HM2UY4DN.mjs +0 -17
- package/dist/Channel-IKL3SJXN.mjs +0 -17
- package/dist/Channel-KILNV5V3.mjs +0 -17
- package/dist/Channel-KOTARBSF.mjs +0 -17
- package/dist/Channel-ON7O3D3M.mjs +0 -17
- package/dist/Channel-TOAQGSRX.mjs +0 -17
- package/dist/Channel-VENHOL7S.mjs +0 -17
- package/dist/Channel-YVGPVOVB.mjs +0 -17
- package/dist/ClientUser-6HBAPU6H.mjs +0 -8
- package/dist/ClientUser-ALGC4FNY.mjs +0 -8
- package/dist/ClientUser-J6HQVSDJ.mjs +0 -9
- package/dist/ClientUser-LLL6WX35.mjs +0 -8
- package/dist/ClientUser-N7ZXYAQ3.mjs +0 -8
- package/dist/Guild-36EGAAEW.mjs +0 -8
- package/dist/Guild-5UBZNIGD.mjs +0 -9
- package/dist/Guild-CA3W6DOD.mjs +0 -8
- package/dist/Guild-GIXJJBFM.mjs +0 -9
- package/dist/Guild-NHNQ5TIA.mjs +0 -8
- package/dist/Guild-S436SLOP.mjs +0 -9
- package/dist/Guild-WAFXK2EX.mjs +0 -9
- package/dist/Guild-XPOMHZZG.mjs +0 -9
- package/dist/Guild-ZOFF5LFR.mjs +0 -8
- package/dist/GuildMember-FX2JAWES.mjs +0 -8
- package/dist/GuildMember-K5FLBNHV.mjs +0 -8
- package/dist/GuildMember-RGVPVUAG.mjs +0 -9
- package/dist/GuildMember-UBNHZBCO.mjs +0 -8
- package/dist/GuildMember-UU26WJGN.mjs +0 -8
- package/dist/GuildMember-XF7K2R45.mjs +0 -9
- package/dist/Message-23Z3RPCZ.mjs +0 -9
- package/dist/Message-33APPS76.mjs +0 -9
- package/dist/Message-6RSAGIRP.mjs +0 -8
- package/dist/Message-OXTQHFCF.mjs +0 -8
- package/dist/Message-PZUU7ZFR.mjs +0 -9
- package/dist/Message-R7GZYIQQ.mjs +0 -8
- package/dist/Message-W624MHJF.mjs +0 -8
- package/dist/Message-XB5WNMHL.mjs +0 -9
- package/dist/Message-ZCS7IGJX.mjs +0 -8
- package/dist/Webhook-TGAZZRQQ.mjs +0 -7
- package/dist/chunk-2FIZRRSO.mjs +0 -88
- package/dist/chunk-3CNUPFDI.mjs +0 -59
- package/dist/chunk-4DBGMFOQ.mjs +0 -14
- package/dist/chunk-5HQRX3KJ.mjs +0 -70
- package/dist/chunk-62S4AB2S.mjs +0 -54
- package/dist/chunk-6CEMF2LO.mjs +0 -14
- package/dist/chunk-6EBNOON4.mjs +0 -86
- package/dist/chunk-72OY7B3D.mjs +0 -72
- package/dist/chunk-7FYM4D2E.mjs +0 -50
- package/dist/chunk-7GZN6JXT.mjs +0 -50
- package/dist/chunk-7H3TKJUT.mjs +0 -53
- package/dist/chunk-7SIS5CUA.mjs +0 -14
- package/dist/chunk-BGJSL6JI.mjs +0 -14
- package/dist/chunk-BUEXP5SZ.mjs +0 -70
- package/dist/chunk-BYTAODAO.mjs +0 -70
- package/dist/chunk-CQ5ZVTLX.mjs +0 -71
- package/dist/chunk-DJBCSVZX.mjs +0 -102
- package/dist/chunk-DLROMCIJ.mjs +0 -50
- package/dist/chunk-DPZHAYCK.mjs +0 -71
- package/dist/chunk-E75ZVY3I.mjs +0 -14
- package/dist/chunk-EF32ILJL.mjs +0 -102
- package/dist/chunk-F2EEQP5O.mjs +0 -86
- package/dist/chunk-FK5X6HFL.mjs +0 -111
- package/dist/chunk-FNFID6QB.mjs +0 -45
- package/dist/chunk-G4L7WAJS.mjs +0 -64
- package/dist/chunk-GUNWHOQO.mjs +0 -42
- package/dist/chunk-IPHFDI2L.mjs +0 -68
- package/dist/chunk-JJHZBWZM.mjs +0 -118
- package/dist/chunk-L25ON7WB.mjs +0 -52
- package/dist/chunk-LBBIQOSH.mjs +0 -53
- package/dist/chunk-LVMFPATK.mjs +0 -54
- package/dist/chunk-NOLYW3V4.mjs +0 -140
- package/dist/chunk-OHIHIQAS.mjs +0 -102
- package/dist/chunk-P4IRDGB4.mjs +0 -43
- package/dist/chunk-PO5JZQVN.mjs +0 -111
- package/dist/chunk-PYYXC7US.mjs +0 -76
- package/dist/chunk-QDCFQF6J.mjs +0 -36
- package/dist/chunk-QDNFJVVE.mjs +0 -70
- package/dist/chunk-QXJNV5EJ.mjs +0 -110
- package/dist/chunk-RXHJYGSJ.mjs +0 -53
- package/dist/chunk-SW6KNICI.mjs +0 -52
- package/dist/chunk-TE5IC7IP.mjs +0 -36
- package/dist/chunk-TMDZALIN.mjs +0 -110
- package/dist/chunk-WFONGZGK.mjs +0 -42
- package/dist/chunk-WZVY7DA6.mjs +0 -44
- package/dist/chunk-XTDZQD4A.mjs +0 -110
- package/dist/chunk-XXCBJJZE.mjs +0 -88
- package/dist/chunk-YKP7JHV2.mjs +0 -102
- package/dist/chunk-YSKZR66G.mjs +0 -102
- package/dist/chunk-ZHRQQZ4X.mjs +0 -102
- package/dist/chunk-ZMIMAMO2.mjs +0 -14
package/package.json
CHANGED
|
@@ -3,8 +3,23 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.9",
|
|
7
7
|
"description": "A fully-featured SDK for Fluxer bots",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/fluxerjs/core.git",
|
|
11
|
+
"directory": "packages/fluxer-core"
|
|
12
|
+
},
|
|
13
|
+
"bugs": "https://github.com/fluxerjs/core/issues",
|
|
14
|
+
"homepage": "https://fluxerjs.blstmo.com",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"fluxer",
|
|
17
|
+
"discord",
|
|
18
|
+
"sdk",
|
|
19
|
+
"bot",
|
|
20
|
+
"api"
|
|
21
|
+
],
|
|
22
|
+
"license": "AGPL-3.0",
|
|
8
23
|
"main": "./dist/index.js",
|
|
9
24
|
"module": "./dist/index.mjs",
|
|
10
25
|
"types": "./dist/index.d.ts",
|
|
@@ -19,12 +34,12 @@
|
|
|
19
34
|
"dist"
|
|
20
35
|
],
|
|
21
36
|
"dependencies": {
|
|
22
|
-
"@fluxerjs/rest": "1.0.
|
|
23
|
-
"@fluxerjs/builders": "1.0.
|
|
24
|
-
"@fluxerjs/
|
|
25
|
-
"@fluxerjs/
|
|
26
|
-
"@fluxerjs/
|
|
27
|
-
"@fluxerjs/
|
|
37
|
+
"@fluxerjs/rest": "1.0.9",
|
|
38
|
+
"@fluxerjs/builders": "1.0.9",
|
|
39
|
+
"@fluxerjs/ws": "1.0.9",
|
|
40
|
+
"@fluxerjs/collection": "1.0.9",
|
|
41
|
+
"@fluxerjs/types": "1.0.9",
|
|
42
|
+
"@fluxerjs/util": "1.0.9"
|
|
28
43
|
},
|
|
29
44
|
"devDependencies": {
|
|
30
45
|
"@types/node": "^20.0.0",
|
|
@@ -36,6 +51,10 @@
|
|
|
36
51
|
},
|
|
37
52
|
"scripts": {
|
|
38
53
|
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
39
|
-
"clean": "rm -rf dist"
|
|
54
|
+
"clean": "rm -rf dist",
|
|
55
|
+
"lint": "eslint src --max-warnings 0 --config ../../eslint.config.js",
|
|
56
|
+
"lint:fix": "eslint src --fix --config ../../eslint.config.js",
|
|
57
|
+
"test": "vitest run --passWithNoTests",
|
|
58
|
+
"test:coverage": "vitest run --coverage --passWithNoTests"
|
|
40
59
|
}
|
|
41
60
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CategoryChannel,
|
|
3
|
-
Channel,
|
|
4
|
-
GuildChannel,
|
|
5
|
-
LinkChannel,
|
|
6
|
-
TextChannel,
|
|
7
|
-
VoiceChannel
|
|
8
|
-
} from "./chunk-ZHRQQZ4X.mjs";
|
|
9
|
-
import "./chunk-XNS4O6QJ.mjs";
|
|
10
|
-
export {
|
|
11
|
-
CategoryChannel,
|
|
12
|
-
Channel,
|
|
13
|
-
GuildChannel,
|
|
14
|
-
LinkChannel,
|
|
15
|
-
TextChannel,
|
|
16
|
-
VoiceChannel
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CategoryChannel,
|
|
3
|
-
Channel,
|
|
4
|
-
GuildChannel,
|
|
5
|
-
LinkChannel,
|
|
6
|
-
TextChannel,
|
|
7
|
-
VoiceChannel
|
|
8
|
-
} from "./chunk-YKP7JHV2.mjs";
|
|
9
|
-
import "./chunk-XNS4O6QJ.mjs";
|
|
10
|
-
export {
|
|
11
|
-
CategoryChannel,
|
|
12
|
-
Channel,
|
|
13
|
-
GuildChannel,
|
|
14
|
-
LinkChannel,
|
|
15
|
-
TextChannel,
|
|
16
|
-
VoiceChannel
|
|
17
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CategoryChannel,
|
|
3
|
-
Channel,
|
|
4
|
-
DMChannel,
|
|
5
|
-
GuildChannel,
|
|
6
|
-
LinkChannel,
|
|
7
|
-
TextChannel,
|
|
8
|
-
VoiceChannel
|
|
9
|
-
} from "./chunk-NOLYW3V4.mjs";
|
|
10
|
-
import "./chunk-XNS4O6QJ.mjs";
|
|
11
|
-
export {
|
|
12
|
-
CategoryChannel,
|
|
13
|
-
Channel,
|
|
14
|
-
DMChannel,
|
|
15
|
-
GuildChannel,
|
|
16
|
-
LinkChannel,
|
|
17
|
-
TextChannel,
|
|
18
|
-
VoiceChannel
|
|
19
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CategoryChannel,
|
|
3
|
-
Channel,
|
|
4
|
-
GuildChannel,
|
|
5
|
-
LinkChannel,
|
|
6
|
-
TextChannel,
|
|
7
|
-
VoiceChannel
|
|
8
|
-
} from "./chunk-6EBNOON4.mjs";
|
|
9
|
-
import "./chunk-XNS4O6QJ.mjs";
|
|
10
|
-
export {
|
|
11
|
-
CategoryChannel,
|
|
12
|
-
Channel,
|
|
13
|
-
GuildChannel,
|
|
14
|
-
LinkChannel,
|
|
15
|
-
TextChannel,
|
|
16
|
-
VoiceChannel
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CategoryChannel,
|
|
3
|
-
Channel,
|
|
4
|
-
GuildChannel,
|
|
5
|
-
LinkChannel,
|
|
6
|
-
TextChannel,
|
|
7
|
-
VoiceChannel
|
|
8
|
-
} from "./chunk-OHIHIQAS.mjs";
|
|
9
|
-
import "./chunk-XNS4O6QJ.mjs";
|
|
10
|
-
export {
|
|
11
|
-
CategoryChannel,
|
|
12
|
-
Channel,
|
|
13
|
-
GuildChannel,
|
|
14
|
-
LinkChannel,
|
|
15
|
-
TextChannel,
|
|
16
|
-
VoiceChannel
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CategoryChannel,
|
|
3
|
-
Channel,
|
|
4
|
-
GuildChannel,
|
|
5
|
-
LinkChannel,
|
|
6
|
-
TextChannel,
|
|
7
|
-
VoiceChannel
|
|
8
|
-
} from "./chunk-XXCBJJZE.mjs";
|
|
9
|
-
import "./chunk-XNS4O6QJ.mjs";
|
|
10
|
-
export {
|
|
11
|
-
CategoryChannel,
|
|
12
|
-
Channel,
|
|
13
|
-
GuildChannel,
|
|
14
|
-
LinkChannel,
|
|
15
|
-
TextChannel,
|
|
16
|
-
VoiceChannel
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CategoryChannel,
|
|
3
|
-
Channel,
|
|
4
|
-
GuildChannel,
|
|
5
|
-
LinkChannel,
|
|
6
|
-
TextChannel,
|
|
7
|
-
VoiceChannel
|
|
8
|
-
} from "./chunk-DJBCSVZX.mjs";
|
|
9
|
-
import "./chunk-XNS4O6QJ.mjs";
|
|
10
|
-
export {
|
|
11
|
-
CategoryChannel,
|
|
12
|
-
Channel,
|
|
13
|
-
GuildChannel,
|
|
14
|
-
LinkChannel,
|
|
15
|
-
TextChannel,
|
|
16
|
-
VoiceChannel
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CategoryChannel,
|
|
3
|
-
Channel,
|
|
4
|
-
GuildChannel,
|
|
5
|
-
LinkChannel,
|
|
6
|
-
TextChannel,
|
|
7
|
-
VoiceChannel
|
|
8
|
-
} from "./chunk-JJHZBWZM.mjs";
|
|
9
|
-
import "./chunk-XNS4O6QJ.mjs";
|
|
10
|
-
export {
|
|
11
|
-
CategoryChannel,
|
|
12
|
-
Channel,
|
|
13
|
-
GuildChannel,
|
|
14
|
-
LinkChannel,
|
|
15
|
-
TextChannel,
|
|
16
|
-
VoiceChannel
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CategoryChannel,
|
|
3
|
-
Channel,
|
|
4
|
-
GuildChannel,
|
|
5
|
-
LinkChannel,
|
|
6
|
-
TextChannel,
|
|
7
|
-
VoiceChannel
|
|
8
|
-
} from "./chunk-F2EEQP5O.mjs";
|
|
9
|
-
import "./chunk-XNS4O6QJ.mjs";
|
|
10
|
-
export {
|
|
11
|
-
CategoryChannel,
|
|
12
|
-
Channel,
|
|
13
|
-
GuildChannel,
|
|
14
|
-
LinkChannel,
|
|
15
|
-
TextChannel,
|
|
16
|
-
VoiceChannel
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CategoryChannel,
|
|
3
|
-
Channel,
|
|
4
|
-
GuildChannel,
|
|
5
|
-
LinkChannel,
|
|
6
|
-
TextChannel,
|
|
7
|
-
VoiceChannel
|
|
8
|
-
} from "./chunk-EF32ILJL.mjs";
|
|
9
|
-
import "./chunk-XNS4O6QJ.mjs";
|
|
10
|
-
export {
|
|
11
|
-
CategoryChannel,
|
|
12
|
-
Channel,
|
|
13
|
-
GuildChannel,
|
|
14
|
-
LinkChannel,
|
|
15
|
-
TextChannel,
|
|
16
|
-
VoiceChannel
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CategoryChannel,
|
|
3
|
-
Channel,
|
|
4
|
-
GuildChannel,
|
|
5
|
-
LinkChannel,
|
|
6
|
-
TextChannel,
|
|
7
|
-
VoiceChannel
|
|
8
|
-
} from "./chunk-YSKZR66G.mjs";
|
|
9
|
-
import "./chunk-XNS4O6QJ.mjs";
|
|
10
|
-
export {
|
|
11
|
-
CategoryChannel,
|
|
12
|
-
Channel,
|
|
13
|
-
GuildChannel,
|
|
14
|
-
LinkChannel,
|
|
15
|
-
TextChannel,
|
|
16
|
-
VoiceChannel
|
|
17
|
-
};
|
package/dist/Guild-36EGAAEW.mjs
DELETED
package/dist/Guild-5UBZNIGD.mjs
DELETED
package/dist/Guild-CA3W6DOD.mjs
DELETED
package/dist/Guild-GIXJJBFM.mjs
DELETED
package/dist/Guild-NHNQ5TIA.mjs
DELETED
package/dist/Guild-S436SLOP.mjs
DELETED
package/dist/Guild-WAFXK2EX.mjs
DELETED
package/dist/Guild-XPOMHZZG.mjs
DELETED
package/dist/Guild-ZOFF5LFR.mjs
DELETED
package/dist/chunk-2FIZRRSO.mjs
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
User
|
|
3
|
-
} from "./chunk-WZVY7DA6.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Base
|
|
6
|
-
} from "./chunk-XNS4O6QJ.mjs";
|
|
7
|
-
|
|
8
|
-
// src/structures/Message.ts
|
|
9
|
-
import { Collection } from "@fluxerjs/collection";
|
|
10
|
-
import { Routes } from "@fluxerjs/types";
|
|
11
|
-
import { EmbedBuilder } from "@fluxerjs/builders";
|
|
12
|
-
var Message = class _Message extends Base {
|
|
13
|
-
client;
|
|
14
|
-
id;
|
|
15
|
-
channelId;
|
|
16
|
-
guildId;
|
|
17
|
-
author;
|
|
18
|
-
content;
|
|
19
|
-
createdAt;
|
|
20
|
-
editedAt;
|
|
21
|
-
pinned;
|
|
22
|
-
attachments;
|
|
23
|
-
channel;
|
|
24
|
-
constructor(client, data) {
|
|
25
|
-
super();
|
|
26
|
-
this.client = client;
|
|
27
|
-
this.id = data.id;
|
|
28
|
-
this.channelId = data.channel_id;
|
|
29
|
-
this.guildId = data.guild_id ?? null;
|
|
30
|
-
this.author = new User(client, data.author);
|
|
31
|
-
this.content = data.content;
|
|
32
|
-
this.createdAt = new Date(data.timestamp);
|
|
33
|
-
this.editedAt = data.edited_timestamp ? new Date(data.edited_timestamp) : null;
|
|
34
|
-
this.pinned = data.pinned;
|
|
35
|
-
this.attachments = new Collection();
|
|
36
|
-
for (const a of data.attachments ?? []) this.attachments.set(a.id, a);
|
|
37
|
-
}
|
|
38
|
-
async reply(options) {
|
|
39
|
-
const body = typeof options === "string" ? { content: options, message_reference: { channel_id: this.channelId, message_id: this.id, guild_id: this.guildId ?? void 0 } } : { ...options, message_reference: { channel_id: this.channelId, message_id: this.id, guild_id: this.guildId ?? void 0 } };
|
|
40
|
-
const data = await this.client.rest.post(Routes.channelMessages(this.channelId), { body });
|
|
41
|
-
return new _Message(this.client, data);
|
|
42
|
-
}
|
|
43
|
-
async edit(options) {
|
|
44
|
-
const body = {};
|
|
45
|
-
if (options.content !== void 0) body.content = options.content;
|
|
46
|
-
if (options.embeds?.length) {
|
|
47
|
-
body.embeds = options.embeds.map((e) => e instanceof EmbedBuilder ? e.toJSON() : e);
|
|
48
|
-
}
|
|
49
|
-
const data = await this.client.rest.patch(Routes.channelMessage(this.channelId, this.id), { body });
|
|
50
|
-
return new _Message(this.client, data);
|
|
51
|
-
}
|
|
52
|
-
async delete() {
|
|
53
|
-
await this.client.rest.delete(Routes.channelMessage(this.channelId, this.id));
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Format emoji for reaction API: unicode string or "name:id" for custom.
|
|
57
|
-
* @param emoji - Unicode emoji (e.g. "👍") or custom { name, id } or "name:id" string
|
|
58
|
-
*/
|
|
59
|
-
static formatEmoji(emoji) {
|
|
60
|
-
if (typeof emoji === "string") return emoji;
|
|
61
|
-
return `${emoji.name}:${emoji.id}`;
|
|
62
|
-
}
|
|
63
|
-
/** Add a reaction to this message (as the bot). */
|
|
64
|
-
async react(emoji) {
|
|
65
|
-
const emojiStr = _Message.formatEmoji(emoji);
|
|
66
|
-
const route = `${Routes.channelMessageReaction(this.channelId, this.id, emojiStr)}/@me`;
|
|
67
|
-
await this.client.rest.put(route);
|
|
68
|
-
}
|
|
69
|
-
/** Remove the bot's reaction, or a specific user's reaction if userId is provided. */
|
|
70
|
-
async removeReaction(emoji, userId) {
|
|
71
|
-
const emojiStr = _Message.formatEmoji(emoji);
|
|
72
|
-
const route = `${Routes.channelMessageReaction(this.channelId, this.id, emojiStr)}/${userId ?? "@me"}`;
|
|
73
|
-
await this.client.rest.delete(route);
|
|
74
|
-
}
|
|
75
|
-
/** Remove all reactions from this message. Requires moderator permissions. */
|
|
76
|
-
async removeAllReactions() {
|
|
77
|
-
await this.client.rest.delete(Routes.channelMessageReactions(this.channelId, this.id));
|
|
78
|
-
}
|
|
79
|
-
/** Remove all reactions of a specific emoji from this message. Requires moderator permissions. */
|
|
80
|
-
async removeReactionEmoji(emoji) {
|
|
81
|
-
const emojiStr = _Message.formatEmoji(emoji);
|
|
82
|
-
await this.client.rest.delete(Routes.channelMessageReaction(this.channelId, this.id, emojiStr));
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export {
|
|
87
|
-
Message
|
|
88
|
-
};
|