@satorijs/adapter-discord 3.8.9 → 3.9.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/lib/bot.d.ts +6 -2
- package/lib/index.js +3 -3
- package/lib/index.js.map +2 -2
- package/package.json +2 -2
package/lib/bot.d.ts
CHANGED
|
@@ -18,9 +18,13 @@ export declare class DiscordBot extends Bot<DiscordBot.Config> {
|
|
|
18
18
|
deleteMessage(channelId: string, messageId: string): Promise<void>;
|
|
19
19
|
editMessage(channelId: string, messageId: string, content: Fragment): Promise<void>;
|
|
20
20
|
getMessage(channelId: string, messageId: string): Promise<Universal.Message>;
|
|
21
|
-
getMessageList(channelId: string, before?: string): Promise<
|
|
21
|
+
getMessageList(channelId: string, before?: string): Promise<{
|
|
22
|
+
data: Universal.Message[];
|
|
23
|
+
}>;
|
|
22
24
|
getUser(userId: string): Promise<Universal.User>;
|
|
23
|
-
getGuildMemberList(guildId: string): Promise<
|
|
25
|
+
getGuildMemberList(guildId: string): Promise<{
|
|
26
|
+
data: Universal.User[];
|
|
27
|
+
}>;
|
|
24
28
|
getChannel(channelId: string): Promise<Universal.Channel>;
|
|
25
29
|
getGuildMember(guildId: string, userId: string): Promise<{
|
|
26
30
|
nickname: string;
|
package/lib/index.js
CHANGED
|
@@ -1992,8 +1992,8 @@ var _DiscordBot = class _DiscordBot extends import_satori5.Bot {
|
|
|
1992
1992
|
return await decodeMessage(this, data);
|
|
1993
1993
|
}
|
|
1994
1994
|
async getMessageList(channelId, before) {
|
|
1995
|
-
const data =
|
|
1996
|
-
return await Promise.all(data.map((data2) => decodeMessage(this, data2, {}, false)));
|
|
1995
|
+
const data = await this.internal.getChannelMessages(channelId, { before, limit: 100 });
|
|
1996
|
+
return { data: await Promise.all(data.reverse().map((data2) => decodeMessage(this, data2, {}, false))) };
|
|
1997
1997
|
}
|
|
1998
1998
|
async getUser(userId) {
|
|
1999
1999
|
const data = await this.internal.getUser(userId);
|
|
@@ -2001,7 +2001,7 @@ var _DiscordBot = class _DiscordBot extends import_satori5.Bot {
|
|
|
2001
2001
|
}
|
|
2002
2002
|
async getGuildMemberList(guildId) {
|
|
2003
2003
|
const data = await this.internal.listGuildMembers(guildId);
|
|
2004
|
-
return data.map((v) => decodeUser(v.user));
|
|
2004
|
+
return { data: data.map((v) => decodeUser(v.user)) };
|
|
2005
2005
|
}
|
|
2006
2006
|
async getChannel(channelId) {
|
|
2007
2007
|
const data = await this.internal.getChannel(channelId);
|