@koishijs/plugin-adapter-discord 2.0.6 → 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 +17 -28
- package/lib/index.js.map +2 -2
- package/lib/sender.d.ts +1 -1
- package/lib/utils.d.ts +1 -1
- package/lib/ws.d.ts +3 -3
- package/package.json +6 -5
package/lib/sender.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare class Sender {
|
|
|
27
27
|
private results;
|
|
28
28
|
private errors;
|
|
29
29
|
private constructor();
|
|
30
|
-
static from(bot: DiscordBot, url: string): (content: string, addition?: Dict<any>) => Promise<string[]>;
|
|
30
|
+
static from(bot: DiscordBot, url: string): (content: string, addition?: Dict<any, string>) => Promise<string[]>;
|
|
31
31
|
post(data?: any, headers?: any): Promise<void>;
|
|
32
32
|
sendEmbed(fileBuffer: ArrayBuffer, payload_json: Dict, filename: string): Promise<void>;
|
|
33
33
|
sendContent(content: string, addition: Dict): Promise<void>;
|
package/lib/utils.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export declare const adaptUser: (user: DC.User) => Bot.User;
|
|
|
10
10
|
export declare function adaptGroup(data: DC.Guild): Bot.Guild;
|
|
11
11
|
export declare function adaptChannel(data: DC.Channel): Bot.Channel;
|
|
12
12
|
export declare const adaptAuthor: (author: DC.User) => Bot.Author;
|
|
13
|
-
export declare function adaptMessage(
|
|
13
|
+
export declare function adaptMessage(meta: DC.Message, session?: Partial<Session>): Bot.Message;
|
|
14
14
|
export declare function adaptSession(bot: DiscordBot, input: DC.GatewayPayload): Promise<Session<never, never>>;
|
package/lib/ws.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
/// <reference types="ws" />
|
|
1
2
|
import { Adapter } from 'koishi';
|
|
2
3
|
import { AdapterConfig } from './utils';
|
|
3
4
|
import { BotConfig, DiscordBot } from './bot';
|
|
4
|
-
import WebSocket from 'ws';
|
|
5
5
|
export default class WebSocketClient extends Adapter.WebSocketClient<BotConfig, AdapterConfig> {
|
|
6
|
-
static schema: import("schemastery")
|
|
7
|
-
prepare(bot: DiscordBot):
|
|
6
|
+
static schema: import("schemastery")<unknown, any>;
|
|
7
|
+
prepare(bot: DiscordBot): import("ws");
|
|
8
8
|
heartbeat(bot: DiscordBot): void;
|
|
9
9
|
accept(bot: DiscordBot): void;
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koishijs/plugin-adapter-discord",
|
|
3
3
|
"description": "Discord Adapter for Koishi",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.9",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/koishijs/koishi.git"
|
|
18
|
+
"url": "git+https://github.com/koishijs/koishi.git",
|
|
19
|
+
"directory": "plugins/adapter/discord"
|
|
19
20
|
},
|
|
20
21
|
"bugs": {
|
|
21
22
|
"url": "https://github.com/koishijs/koishi/issues"
|
|
@@ -29,10 +30,10 @@
|
|
|
29
30
|
"impl:adapter"
|
|
30
31
|
],
|
|
31
32
|
"peerDependencies": {
|
|
32
|
-
"koishi": "^4.
|
|
33
|
+
"koishi": "^4.6.3"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
|
-
"@koishijs/plugin-mock": "^1.0.
|
|
36
|
+
"@koishijs/plugin-mock": "^1.0.4",
|
|
36
37
|
"@types/es-aggregate-error": "^1.0.2",
|
|
37
38
|
"@types/ws": "^8.5.3",
|
|
38
39
|
"axios": "^0.24.0"
|
|
@@ -41,6 +42,6 @@
|
|
|
41
42
|
"es-aggregate-error": "^1.0.7",
|
|
42
43
|
"file-type": "^16.5.3",
|
|
43
44
|
"form-data": "^4.0.0",
|
|
44
|
-
"ws": "^8.
|
|
45
|
+
"ws": "^8.6.0"
|
|
45
46
|
}
|
|
46
47
|
}
|