kook-client 1.0.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.
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Channel = void 0;
4
+ const contact_1 = require("../entries/contact");
5
+ const _1 = require("..");
6
+ const event_1 = require("../event");
7
+ class Channel extends contact_1.Contact {
8
+ constructor(c, info) {
9
+ super(c);
10
+ this.info = info;
11
+ }
12
+ async update(newInfo) {
13
+ const { data } = await this.c.request.post('/v3/channel/update', {
14
+ channel_id: this.info.id,
15
+ ...newInfo
16
+ });
17
+ // 更新缓存
18
+ this.c.channels.set(this.info.id, data);
19
+ Channel.map.delete(this.info);
20
+ Channel.map.set(data, this);
21
+ this.info = data;
22
+ }
23
+ async delete() {
24
+ const result = await this.c.request.post('/v3/channel/delete', {
25
+ channel_id: this.info.id
26
+ });
27
+ if (result['code'] !== 0)
28
+ throw new Error(result['message']);
29
+ // 清空本地缓存
30
+ this.c.channels.delete(this.info.id);
31
+ this.c.channelMembers.delete(this.info.id);
32
+ Channel.map.delete(this.info);
33
+ }
34
+ async addUsers(user_ids) {
35
+ const result = await this.c.request.post('/v3/channel/move-user', {
36
+ channel_id: this.info.id,
37
+ user_ids
38
+ });
39
+ return result['code'] === 0;
40
+ }
41
+ async getMsg(message_id) {
42
+ const { data } = await this.c.request.get('/v3/message/view', {
43
+ params: {
44
+ msg_id: message_id
45
+ }
46
+ });
47
+ return event_1.ChannelMessageEvent.fromDetail(this.c, this.info.id, data);
48
+ }
49
+ async getUserList() {
50
+ const { data } = await this.c.request.get('/v3/channel/user-list', {
51
+ params: {
52
+ channel_id: this.info.id
53
+ }
54
+ });
55
+ return data;
56
+ }
57
+ /**
58
+ * 获取指定消息之前的聊天历史
59
+ * @param message_id {string} 消息id 不传则查询最新消息
60
+ * @param len {number} 获取的聊天历史长度 默认50条
61
+ */
62
+ async getChatHistory(message_id, len = 50) {
63
+ const result = await this.c.request.post('/v3/message/list', {
64
+ target_id: this.info.id,
65
+ msg_id: message_id,
66
+ page_size: len
67
+ });
68
+ return (result?.data?.items || []).map((item) => {
69
+ return event_1.ChannelMessageEvent.fromDetail(this.c, this.info.id, item);
70
+ });
71
+ }
72
+ async sendMsg(message, quote) {
73
+ const [content, quoteObj, type] = await _1.Message.processMessage.call(this.c, message, quote);
74
+ const { data } = await this.c.request.post('/v3/message/create', {
75
+ target_id: this.info.id,
76
+ content, // 处理后的内容(图片URL / 文本 / Markdown / Card JSON)
77
+ type: type ?? 1, // 默认文本消息(type=1)
78
+ quote: quoteObj?.message_id,
79
+ });
80
+ if (!data)
81
+ throw new Error('发送消息失败');
82
+ this.c.logger.info(`send to Channel(${this.info.id}): `, content);
83
+ return data;
84
+ }
85
+ async recallMsg(message_id) {
86
+ const result = await this.c.request.post('/v3/message/delete', {
87
+ msg_id: message_id
88
+ });
89
+ return result['code'] === 0;
90
+ }
91
+ async updateMsg(message_id, newMessage, quote) {
92
+ [newMessage, quote] = await _1.Message.processMessage.call(this.c, newMessage, quote);
93
+ const result = await this.c.request.post('/v3/message/update', {
94
+ msg_id: message_id,
95
+ content: newMessage,
96
+ quote: quote?.message_id
97
+ });
98
+ return result['code'] === 0;
99
+ }
100
+ async getMsgReactions(message_id, emoji) {
101
+ const result = await this.c.request.get('/v3/message/reaction-list', {
102
+ params: {
103
+ msg_id: message_id,
104
+ emoji: emoji ? encodeURI(emoji) : null
105
+ }
106
+ });
107
+ return result.data;
108
+ }
109
+ async addMsgReaction(message_id, emoji) {
110
+ await this.c.request.post('/v3/message/add-reaction', {
111
+ msg_id: message_id,
112
+ emoji
113
+ });
114
+ }
115
+ async deleteMsgReaction(message_id, emoji, user_id) {
116
+ await this.c.request.post('/v3/message/delete-reaction', {
117
+ msg_id: message_id,
118
+ emoji,
119
+ user_id
120
+ });
121
+ }
122
+ }
123
+ exports.Channel = Channel;
124
+ (function (Channel) {
125
+ Channel.map = new WeakMap();
126
+ function as(channel_id) {
127
+ const channelInfo = this.channels.get(channel_id);
128
+ if (!channelInfo)
129
+ throw new Error(`未找到${channel_id}频道`);
130
+ if (Channel.map.has(channelInfo))
131
+ return Channel.map.get(channelInfo);
132
+ const channel = new Channel(this, channelInfo);
133
+ Channel.map.set(channelInfo, channel);
134
+ return channel;
135
+ }
136
+ Channel.as = as;
137
+ })(Channel || (exports.Channel = Channel = {}));
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChannelMember = void 0;
4
+ const user_1 = require("../entries/user");
5
+ class ChannelMember extends user_1.User {
6
+ constructor(c, channel_id, info) {
7
+ super(c, info);
8
+ this.channel_id = channel_id;
9
+ }
10
+ get channel() {
11
+ return this.c.pickChannel(this.channel_id);
12
+ }
13
+ async move(channel_id) {
14
+ return this.channel.addUsers([this.info.id]);
15
+ }
16
+ }
17
+ exports.ChannelMember = ChannelMember;
18
+ (function (ChannelMember) {
19
+ ChannelMember.map = new WeakMap();
20
+ function as(channel_id, user_id) {
21
+ const memberInfo = this.channelMembers.get(channel_id)?.get(user_id);
22
+ if (!memberInfo)
23
+ throw new Error(`频道(${channel_id}) 不存在成员(${user_id})`);
24
+ if (ChannelMember.map.has(memberInfo))
25
+ return ChannelMember.map.get(memberInfo);
26
+ const member = new ChannelMember(this, channel_id, memberInfo);
27
+ ChannelMember.map.set(memberInfo, member);
28
+ return member;
29
+ }
30
+ ChannelMember.as = as;
31
+ })(ChannelMember || (exports.ChannelMember = ChannelMember = {}));
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Contact = void 0;
4
+ class Contact {
5
+ constructor(c) {
6
+ this.c = c;
7
+ }
8
+ }
9
+ exports.Contact = Contact;
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Guild = void 0;
4
+ const contact_1 = require("../entries/contact");
5
+ const constans_1 = require("../constans");
6
+ class Guild extends contact_1.Contact {
7
+ constructor(c, info) {
8
+ super(c);
9
+ this.info = info;
10
+ }
11
+ async renew() {
12
+ const { data } = await this.c.request.get('/v3/guild/view', {
13
+ params: {
14
+ guild_id: this.info.id
15
+ }
16
+ });
17
+ this.info = data;
18
+ }
19
+ async quit() {
20
+ const result = await this.c.request.post('/v3/guild/leave', {
21
+ guild_id: this.info.id
22
+ });
23
+ if (result['code'] === 0)
24
+ return this.c.guilds.delete(this.info.id);
25
+ throw new Error(result['message']);
26
+ }
27
+ async getRoleList() {
28
+ const _getRoleList = async (page = 1, page_size = 100) => {
29
+ const { data: { items = [], meta = { page: 1, total_page: 1 } } } = await this.c.request.get('/v3/guild-role/list', {
30
+ params: {
31
+ guild_id: this.info.id,
32
+ page
33
+ }
34
+ });
35
+ if (meta.total_page <= page)
36
+ return items;
37
+ return items.concat(await _getRoleList(page + 1, page_size));
38
+ };
39
+ return await _getRoleList();
40
+ }
41
+ async createRole(name) {
42
+ const { data } = await this.c.request.post('/v3/guild-role/create', {
43
+ guild_id: this.info.id,
44
+ name
45
+ });
46
+ return data;
47
+ }
48
+ async updateRole(role_id, update_info) {
49
+ const { data } = await this.c.request.post('/v3/guild-role/update', {
50
+ guild_id: this.info.id,
51
+ role_id,
52
+ ...update_info
53
+ });
54
+ return data;
55
+ }
56
+ async deleteRole(role_id) {
57
+ const result = await this.c.request.post('/v3/guild-role/delete', {
58
+ guild_id: this.info.id,
59
+ role_id
60
+ });
61
+ if (result['code'] === 0)
62
+ return true;
63
+ throw new Error(result['message']);
64
+ }
65
+ async kick(user_id) {
66
+ const result = await this.c.request.post('/v3/guild/kickout', {
67
+ guild_id: this.info.id,
68
+ target_id: user_id
69
+ });
70
+ if (result['code'] === 0)
71
+ return true;
72
+ throw new Error(result['message']);
73
+ }
74
+ async createChannel(channel_info) {
75
+ const { data } = await this.c.request.post('/v3/channel/create', {
76
+ guild_id: this.info.id,
77
+ ...channel_info
78
+ });
79
+ return data;
80
+ }
81
+ async sendMsg(message, quote) {
82
+ throw constans_1.UnsupportedMethodError;
83
+ }
84
+ recallMsg(message_id) {
85
+ throw constans_1.UnsupportedMethodError;
86
+ }
87
+ updateMsg(message_id, newMessage) {
88
+ throw constans_1.UnsupportedMethodError;
89
+ }
90
+ getMsg(message_id) {
91
+ throw constans_1.UnsupportedMethodError;
92
+ }
93
+ }
94
+ exports.Guild = Guild;
95
+ (function (Guild) {
96
+ Guild.map = new WeakMap();
97
+ function as(guild_id) {
98
+ const guildInfo = this.guilds.get(guild_id);
99
+ if (!guildInfo)
100
+ throw new Error(`未找到${guild_id}服务器`);
101
+ if (Guild.map.has(guildInfo))
102
+ return Guild.map.get(guildInfo);
103
+ const guild = new Guild(this, guildInfo);
104
+ Guild.map.set(guildInfo, guild);
105
+ return guild;
106
+ }
107
+ Guild.as = as;
108
+ let Permission;
109
+ (function (Permission) {
110
+ Permission[Permission["Admin"] = 1] = "Admin";
111
+ Permission[Permission["ManageGuild"] = 2] = "ManageGuild";
112
+ Permission[Permission["ViewAdminLog"] = 4] = "ViewAdminLog";
113
+ Permission[Permission["CreateGuildInvite"] = 8] = "CreateGuildInvite";
114
+ Permission[Permission["ManageInvite"] = 16] = "ManageInvite";
115
+ Permission[Permission["ManageChannel"] = 32] = "ManageChannel";
116
+ Permission[Permission["KickUser"] = 64] = "KickUser";
117
+ Permission[Permission["BanUser"] = 128] = "BanUser";
118
+ Permission[Permission["ManageCustomFace"] = 256] = "ManageCustomFace";
119
+ Permission[Permission["UpdateGuildName"] = 512] = "UpdateGuildName";
120
+ Permission[Permission["ManageRole"] = 1024] = "ManageRole";
121
+ Permission[Permission["ViewContentOrVoiceChannel"] = 2048] = "ViewContentOrVoiceChannel";
122
+ Permission[Permission["PublishMsg"] = 4096] = "PublishMsg";
123
+ Permission[Permission["ManageMsg"] = 8192] = "ManageMsg";
124
+ Permission[Permission["UploadFile"] = 16384] = "UploadFile";
125
+ Permission[Permission["VoiceLink"] = 32768] = "VoiceLink";
126
+ Permission[Permission["ManageVoice"] = 65536] = "ManageVoice";
127
+ Permission[Permission["AtAll"] = 131072] = "AtAll";
128
+ Permission[Permission["AddReaction"] = 262144] = "AddReaction";
129
+ Permission[Permission["FollowReaction"] = 524288] = "FollowReaction";
130
+ Permission[Permission["PassiveLinkVoiceChannel"] = 1048576] = "PassiveLinkVoiceChannel";
131
+ Permission[Permission["PressKeyTalk"] = 2097152] = "PressKeyTalk";
132
+ Permission[Permission["FreeTally"] = 4194304] = "FreeTally";
133
+ Permission[Permission["Talk"] = 8388608] = "Talk";
134
+ Permission[Permission["MuteGuild"] = 16777216] = "MuteGuild";
135
+ Permission[Permission["CloseGuildWheat"] = 33554432] = "CloseGuildWheat";
136
+ Permission[Permission["UpdateOtherUserNickname"] = 67108864] = "UpdateOtherUserNickname";
137
+ Permission[Permission["PlayMusic"] = 134217728] = "PlayMusic";
138
+ })(Permission = Guild.Permission || (Guild.Permission = {}));
139
+ })(Guild || (exports.Guild = Guild = {}));
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GuildMember = void 0;
4
+ const user_1 = require("../entries/user");
5
+ class GuildMember extends user_1.User {
6
+ constructor(c, guild_id, info) {
7
+ super(c, info);
8
+ this.guild_id = guild_id;
9
+ }
10
+ get guild() {
11
+ return this.c.pickGuild(this.guild_id);
12
+ }
13
+ async setNickname(nickname) {
14
+ const result = await this.c.request.post('/v3/guild/nickname', {
15
+ guild_id: this.guild_id,
16
+ nickname,
17
+ user_id: this.info.id
18
+ });
19
+ return result['code'] === 0;
20
+ }
21
+ async grant(role_id) {
22
+ const result = await this.c.request.post('/v3/guild/role', {
23
+ guild_id: this.guild_id,
24
+ role_id,
25
+ user_id: this.info.id
26
+ });
27
+ return result['code'] === 0;
28
+ }
29
+ async revoke(role_id) {
30
+ const result = await this.c.request.post('/v3/guild/role', {
31
+ guild_id: this.guild_id,
32
+ role_id,
33
+ user_id: this.info.id
34
+ });
35
+ return result['code'] === 0;
36
+ }
37
+ async addToBlackList(remark, del_msg_days = 0) {
38
+ if (this.c.blacklist.get(this.guild_id)?.has(this.info.id))
39
+ throw new Error(`用户(${this.info.id}) 已在黑名单中`);
40
+ const result = await this.c.request.post('/v3/blacklist/create', {
41
+ guild_id: this.guild_id,
42
+ user_id: this.info.id,
43
+ remark,
44
+ del_msg_days
45
+ });
46
+ return result['code'] === 0;
47
+ }
48
+ async removeFromBlackList() {
49
+ const result = await this.c.request.post('/v3/blacklist/delete', {
50
+ guild_id: this.guild_id,
51
+ user_id: this.info.id
52
+ });
53
+ return result['code'] === 0;
54
+ }
55
+ kick() {
56
+ return this.guild.kick(this.info.id);
57
+ }
58
+ }
59
+ exports.GuildMember = GuildMember;
60
+ (function (GuildMember) {
61
+ GuildMember.map = new WeakMap();
62
+ function as(guild_id, user_id) {
63
+ const memberInfo = this.guildMembers.get(guild_id)?.get(user_id);
64
+ if (!memberInfo)
65
+ throw new Error(`服务器(${guild_id}) 不存在成员(${user_id})`);
66
+ if (GuildMember.map.has(memberInfo))
67
+ return GuildMember.map.get(memberInfo);
68
+ const member = new GuildMember(this, guild_id, memberInfo);
69
+ GuildMember.map.set(memberInfo, member);
70
+ return member;
71
+ }
72
+ GuildMember.as = as;
73
+ })(GuildMember || (exports.GuildMember = GuildMember = {}));
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.User = void 0;
4
+ const contact_1 = require("../entries/contact");
5
+ const _1 = require("..");
6
+ const event_1 = require("../event");
7
+ class User extends contact_1.Contact {
8
+ constructor(c, info) {
9
+ super(c);
10
+ this.info = info;
11
+ }
12
+ async sendMsg(message, quote) {
13
+ let isCard;
14
+ // [message,quote,isCard]=await Message.processMessage.call(this.c,message,quote)
15
+ const [content, quoteObj, type] = await _1.Message.processMessage.call(this.c, message, quote);
16
+ const { data } = await this.c.request.post('/v3/direct-message/create', {
17
+ target_id: this.info.id,
18
+ content, // 处理后的内容(图片URL / 文本 / Markdown / Card JSON)
19
+ type: type ?? 1, // 默认文本消息(type=1)
20
+ quote: quoteObj?.message_id,
21
+ });
22
+ if (!data)
23
+ throw new Error('发送消息失败');
24
+ this.c.logger.info(`send to User(${this.info.id}): `, message);
25
+ return data;
26
+ }
27
+ async recallMsg(message_id) {
28
+ const result = await this.c.request.post('/v3/direct-message/delete', {
29
+ msg_id: message_id
30
+ });
31
+ return result['code'] === 0;
32
+ }
33
+ async getMsgReactions(message_id, emoji) {
34
+ const result = await this.c.request.get('/v3/direct-message/reaction-list', {
35
+ params: {
36
+ msg_id: message_id,
37
+ emoji: emoji ? encodeURI(emoji) : null
38
+ }
39
+ });
40
+ return result.data;
41
+ }
42
+ async addMsgReaction(message_id, emoji) {
43
+ await this.c.request.post('/v3/direct-message/add-reaction', {
44
+ msg_id: message_id,
45
+ emoji
46
+ });
47
+ }
48
+ async deleteMsgReaction(message_id, emoji, user_id) {
49
+ await this.c.request.post('/v3/direct-message/delete-reaction', {
50
+ msg_id: message_id,
51
+ emoji,
52
+ user_id
53
+ });
54
+ }
55
+ async updateMsg(message_id, newMessage, quote) {
56
+ [newMessage, quote] = await _1.Message.processMessage.call(this.c, newMessage, quote);
57
+ const result = await this.c.request.post('/v3/direct-message/update', {
58
+ msg_id: message_id,
59
+ content: newMessage,
60
+ quote: quote?.message_id
61
+ });
62
+ return result['code'] === 0;
63
+ }
64
+ /**
65
+ * 获取指定消息之前的聊天历史
66
+ * @param message_id {string} 消息id 不传则查询最新消息
67
+ * @param len {number} 获取的聊天历史长度 默认50条
68
+ */
69
+ async getChatHistory(message_id, len = 50) {
70
+ const result = await this.c.request.post('/v3/direct-message/list', {
71
+ target_id: this.info.id,
72
+ msg_id: message_id,
73
+ page_size: len
74
+ });
75
+ return (result?.data?.items || []).map((item) => {
76
+ return event_1.PrivateMessageEvent.fromDetail(this.c, this.info.id, item);
77
+ });
78
+ }
79
+ async getMsg(message_id) {
80
+ const { data } = await this.c.request.get('/v3/direct-message/view', {
81
+ params: {
82
+ msg_id: message_id
83
+ }
84
+ });
85
+ return event_1.PrivateMessageEvent.fromDetail(this.c, this.info.id, data);
86
+ }
87
+ asGuildMember(guild_id) {
88
+ return this.c.pickGuildMember(guild_id, this.info.id);
89
+ }
90
+ asChannelMember(channel_id) {
91
+ return this.c.pickChannelMember(channel_id, this.info.id);
92
+ }
93
+ }
94
+ exports.User = User;
95
+ (function (User) {
96
+ User.map = new WeakMap();
97
+ function as(user_id, from_id) {
98
+ const userInfo = this.users.get(user_id);
99
+ if (!userInfo)
100
+ throw new Error(`未找到${user_id}用户`);
101
+ if (User.map.has(userInfo))
102
+ return User.map.get(userInfo);
103
+ const user = new User(this, userInfo);
104
+ User.map.set(userInfo, user);
105
+ return user;
106
+ }
107
+ User.as = as;
108
+ let Permission;
109
+ (function (Permission) {
110
+ Permission[Permission["normal"] = 1] = "normal";
111
+ Permission[Permission["admin"] = 2] = "admin";
112
+ Permission[Permission["owner"] = 4] = "owner";
113
+ Permission[Permission["channelAdmin"] = 5] = "channelAdmin";
114
+ })(Permission = User.Permission || (User.Permission = {}));
115
+ })(User || (exports.User = User = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./message"), exports);
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChannelMessageEvent = exports.PrivateMessageEvent = void 0;
4
+ const message_1 = require("../message");
5
+ const constans_1 = require("../constans");
6
+ class PrivateMessageEvent extends message_1.Message {
7
+ constructor(client, payload) {
8
+ super(client, payload);
9
+ this.message_type = 'private';
10
+ }
11
+ static fromDetail(client, user_id, detail) {
12
+ const payload = {
13
+ target_id: client.self_id === detail.author.id ? user_id : client.self_id,
14
+ author_id: detail.author.id,
15
+ type: detail.type,
16
+ channel_type: constans_1.ChannelType.Private,
17
+ msg_id: detail.id,
18
+ msg_timestamp: detail.create_at,
19
+ content: detail.content,
20
+ extra: detail
21
+ };
22
+ return new PrivateMessageEvent(client, payload);
23
+ }
24
+ getReactions(emoji) {
25
+ return this.author.getMsgReactions(this.message_id, emoji);
26
+ }
27
+ addReaction(emoji) {
28
+ return this.author.addMsgReaction(this.message_id, emoji);
29
+ }
30
+ deleteReaction(emoji, user_id) {
31
+ return this.author.deleteMsgReaction(this.message_id, emoji, user_id);
32
+ }
33
+ async recall() {
34
+ return this.author.recallMsg(this.message_id);
35
+ }
36
+ async update(message, quote) {
37
+ return this.author.updateMsg(this.message_id, message, quote && this);
38
+ }
39
+ async reply(message, quote = false) {
40
+ return this.author.sendMsg(message, quote && this);
41
+ }
42
+ }
43
+ exports.PrivateMessageEvent = PrivateMessageEvent;
44
+ class ChannelMessageEvent extends message_1.Message {
45
+ constructor(client, payload) {
46
+ super(client, payload);
47
+ this.channel_id = payload.target_id;
48
+ this.channel_name = payload.extra.channel_name;
49
+ this.message_type = 'channel';
50
+ }
51
+ static fromDetail(client, channel_id, detail) {
52
+ const payload = {
53
+ target_id: channel_id,
54
+ author_id: detail.author.id,
55
+ type: detail.type,
56
+ channel_type: constans_1.ChannelType.Channel,
57
+ msg_id: detail.id,
58
+ msg_timestamp: detail.create_at,
59
+ content: detail.content,
60
+ extra: detail
61
+ };
62
+ return new ChannelMessageEvent(client, payload);
63
+ }
64
+ get channel() {
65
+ return this.client.pickChannel(this.channel_id);
66
+ }
67
+ async recall() {
68
+ return this.channel.recallMsg(this.message_id);
69
+ }
70
+ async update(message) {
71
+ return this.channel.updateMsg(this.message_id, message);
72
+ }
73
+ async reply(message, quote = false) {
74
+ return this.channel.sendMsg(message, quote && this);
75
+ }
76
+ getReactions(emoji) {
77
+ return this.channel.getMsgReactions(this.message_id, emoji);
78
+ }
79
+ addReaction(emoji) {
80
+ return this.channel.addMsgReaction(this.message_id, emoji);
81
+ }
82
+ deleteReaction(emoji, user_id) {
83
+ return this.channel.deleteMsgReaction(this.message_id, emoji, user_id);
84
+ }
85
+ }
86
+ exports.ChannelMessageEvent = ChannelMessageEvent;