@koishijs/plugin-adapter-discord 2.0.8 → 2.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/lib/bot.d.ts +1 -0
- package/lib/index.js +4 -1
- package/lib/index.js.map +2 -2
- package/lib/sender.d.ts +1 -1
- package/lib/ws.d.ts +1 -1
- package/package.json +6 -5
package/lib/bot.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare class DiscordBot extends Bot<BotConfig> {
|
|
|
40
40
|
discriminator?: string;
|
|
41
41
|
isBot?: boolean;
|
|
42
42
|
}>;
|
|
43
|
+
kickGuildMember(guildId: string, userId: string): Promise<void>;
|
|
43
44
|
getGuild(guildId: string): Promise<Bot.Guild>;
|
|
44
45
|
getGuildList(): Promise<Bot.Guild[]>;
|
|
45
46
|
getChannelList(guildId: string): Promise<Bot.Channel[]>;
|
package/lib/index.js
CHANGED
|
@@ -244,7 +244,7 @@ function adaptMessage(meta, session = {}) {
|
|
|
244
244
|
}
|
|
245
245
|
session.content = "";
|
|
246
246
|
if (meta.content) {
|
|
247
|
-
session.content = meta.content.replace(/<@[!&](.+?)>/g, (_, id) => {
|
|
247
|
+
session.content = meta.content.replace(/<@[!&]?(.+?)>/g, (_, id) => {
|
|
248
248
|
var _a2;
|
|
249
249
|
if (meta.mention_roles.includes(id)) {
|
|
250
250
|
return (0, import_koishi2.segment)("at", { role: id });
|
|
@@ -1430,6 +1430,9 @@ var DiscordBot = class extends import_koishi4.Bot {
|
|
|
1430
1430
|
nickname: member.nick
|
|
1431
1431
|
});
|
|
1432
1432
|
}
|
|
1433
|
+
async kickGuildMember(guildId, userId) {
|
|
1434
|
+
return this.internal.removeGuildMember(guildId, userId);
|
|
1435
|
+
}
|
|
1433
1436
|
async getGuild(guildId) {
|
|
1434
1437
|
const data = await this.internal.getGuild(guildId);
|
|
1435
1438
|
return adaptGroup(data);
|