@koishijs/plugin-adapter-discord 2.0.7 → 2.1.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 +2 -0
- package/lib/index.js +33 -9
- package/lib/index.js.map +2 -2
- package/lib/sender.d.ts +1 -1
- package/lib/types/gateway.d.ts +1 -1
- package/lib/types/message.d.ts +4 -4
- package/lib/utils.d.ts +2 -0
- 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/types/gateway.d.ts
CHANGED
package/lib/types/message.d.ts
CHANGED
|
@@ -136,13 +136,13 @@ export declare namespace Message {
|
|
|
136
136
|
/** https://discord.com/developers/docs/resources/channel#get-channel-messages-query-string-params */
|
|
137
137
|
interface GetParams {
|
|
138
138
|
/** get messages around this message ID */
|
|
139
|
-
around
|
|
139
|
+
around?: snowflake;
|
|
140
140
|
/** get messages before this message ID */
|
|
141
|
-
before
|
|
141
|
+
before?: snowflake;
|
|
142
142
|
/** get messages after this message ID */
|
|
143
|
-
after
|
|
143
|
+
after?: snowflake;
|
|
144
144
|
/** max number of messages to return (1-100) */
|
|
145
|
-
limit
|
|
145
|
+
limit?: integer;
|
|
146
146
|
}
|
|
147
147
|
/** https://discord.com/developers/docs/resources/channel#create-message-jsonform-params */
|
|
148
148
|
interface CreateParams extends EditParams {
|
package/lib/utils.d.ts
CHANGED
|
@@ -11,4 +11,6 @@ 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
13
|
export declare function adaptMessage(meta: DC.Message, session?: Partial<Session>): Bot.Message;
|
|
14
|
+
export declare function adaptMessageSession(meta: DC.Message, session?: Partial<Session>): Partial<Session<never, never>>;
|
|
15
|
+
export declare function prepareMessageSession(session: Partial<Session>, data: Partial<DC.Message>): void;
|
|
14
16
|
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.1.0",
|
|
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.7.0"
|
|
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
|
}
|