@koishijs/plugin-adapter-discord 2.1.0 → 2.1.1
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 +17 -2
- package/lib/index.d.ts +1 -3
- package/lib/index.js +0 -4
- package/lib/index.js.map +2 -2
- package/lib/utils.d.ts +0 -1
- package/lib/ws.d.ts +17 -1
- package/package.json +2 -2
package/lib/bot.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="koishi/lib" />
|
|
2
1
|
/// <reference types="node" />
|
|
3
2
|
import { Adapter, Bot, Quester, Schema } from 'koishi';
|
|
4
3
|
import { AdapterConfig } from './utils';
|
|
@@ -12,7 +11,23 @@ export interface BotConfig extends Bot.BaseConfig, Quester.Config {
|
|
|
12
11
|
gateway?: string;
|
|
13
12
|
intents?: PrivilegedIntents;
|
|
14
13
|
}
|
|
15
|
-
export declare const BotConfig: Schema<
|
|
14
|
+
export declare const BotConfig: Schema<Quester.Config & {
|
|
15
|
+
gateway?: string;
|
|
16
|
+
intents?: {
|
|
17
|
+
members?: boolean;
|
|
18
|
+
presence?: boolean;
|
|
19
|
+
} & import("koishi").Dict<any, string>;
|
|
20
|
+
} & import("koishi").Dict<any, string> & {
|
|
21
|
+
token?: string;
|
|
22
|
+
}, Quester.Config & {
|
|
23
|
+
gateway: string;
|
|
24
|
+
intents: {
|
|
25
|
+
members: boolean;
|
|
26
|
+
presence: boolean;
|
|
27
|
+
} & import("koishi").Dict<any, string>;
|
|
28
|
+
} & import("koishi").Dict<any, string> & {
|
|
29
|
+
token: string;
|
|
30
|
+
}>;
|
|
16
31
|
export declare class DiscordBot extends Bot<BotConfig> {
|
|
17
32
|
static schema: Schema<AdapterConfig, AdapterConfig>;
|
|
18
33
|
_d: number;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="index.d.ts" />
|
|
2
|
-
/// <reference types="koishi/lib" />
|
|
3
1
|
import { Adapter } from 'koishi';
|
|
4
2
|
import * as Discord from './types';
|
|
5
3
|
export { Discord };
|
|
@@ -12,5 +10,5 @@ declare module 'koishi' {
|
|
|
12
10
|
discord?: Discord.GatewayPayload & Discord.Internal;
|
|
13
11
|
}
|
|
14
12
|
}
|
|
15
|
-
declare const _default: import("koishi").Plugin.Object<Adapter.PluginConfig<import("./utils").AdapterConfig, import("./bot").BotConfig
|
|
13
|
+
declare const _default: import("koishi").Plugin.Object<Adapter.PluginConfig<import("./utils").AdapterConfig, import("./bot").BotConfig>, any>;
|
|
16
14
|
export default _default;
|
package/lib/index.js
CHANGED
|
@@ -341,15 +341,11 @@ async function adaptSession(bot, input) {
|
|
|
341
341
|
session.type = "message";
|
|
342
342
|
prepareMessageSession(session, input.d);
|
|
343
343
|
adaptMessageSession(input.d, session);
|
|
344
|
-
if (session.userId === bot.selfId)
|
|
345
|
-
return;
|
|
346
344
|
} else if (input.t === "MESSAGE_UPDATE") {
|
|
347
345
|
session.type = "message-updated";
|
|
348
346
|
prepareMessageSession(session, input.d);
|
|
349
347
|
const msg = await bot.internal.getChannelMessage(input.d.channel_id, input.d.id);
|
|
350
348
|
adaptMessageSession(msg, session);
|
|
351
|
-
if (session.userId === bot.selfId)
|
|
352
|
-
return;
|
|
353
349
|
} else if (input.t === "MESSAGE_DELETE") {
|
|
354
350
|
session.type = "message-deleted";
|
|
355
351
|
session.messageId = input.d.id;
|