@koishijs/plugin-adapter-discord 2.0.0 → 2.0.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/sender.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DiscordBot } from './bot';
2
- import { Dict } from 'koishi';
2
+ import { Dict, Schema } from 'koishi';
3
3
  export declare type HandleExternalAsset = 'auto' | 'download' | 'direct';
4
4
  export declare type HandleMixedContent = 'auto' | 'separate' | 'attach';
5
5
  export declare namespace Sender {
@@ -23,6 +23,7 @@ export declare namespace Sender {
23
23
  export declare class Sender {
24
24
  private bot;
25
25
  private url;
26
+ static Config: Schema<Sender.Config>;
26
27
  private results;
27
28
  private errors;
28
29
  private constructor();
package/lib/utils.d.ts CHANGED
@@ -1,12 +1,9 @@
1
1
  /// <reference types="koishi/lib" />
2
- import { Adapter, App, Bot, Schema, Session } from 'koishi';
2
+ import { Adapter, Bot, Schema, Session } from 'koishi';
3
+ import { Sender } from './sender';
3
4
  import { DiscordBot } from './bot';
4
5
  import * as DC from './types';
5
- interface PrivilegedIntents {
6
- members?: boolean;
7
- }
8
- export interface AdapterConfig extends Adapter.WebSocketClient.Config, App.Config.Request {
9
- intents?: PrivilegedIntents;
6
+ export interface AdapterConfig extends Sender.Config, Adapter.WebSocketClient.Config {
10
7
  }
11
8
  export declare const AdapterConfig: Schema<AdapterConfig>;
12
9
  export declare const adaptUser: (user: DC.User) => Bot.User;
@@ -15,4 +12,3 @@ export declare function adaptChannel(data: DC.Channel): Bot.Channel;
15
12
  export declare const adaptAuthor: (author: DC.User) => Bot.Author;
16
13
  export declare function adaptMessage(bot: DiscordBot, meta: DC.Message, session?: Partial<Session>): Bot.Message;
17
14
  export declare function adaptSession(bot: DiscordBot, input: DC.GatewayPayload): Promise<Session<never, never>>;
18
- export {};
package/lib/ws.d.ts CHANGED
@@ -1,14 +1,10 @@
1
- /// <reference path="index.d.ts" />
2
- /// <reference types="koishi/lib" />
3
- import { Adapter, Context } from 'koishi';
1
+ import { Adapter } from 'koishi';
4
2
  import { AdapterConfig } from './utils';
5
3
  import { BotConfig, DiscordBot } from './bot';
6
4
  import WebSocket from 'ws';
7
5
  export default class WebSocketClient extends Adapter.WebSocketClient<BotConfig, AdapterConfig> {
8
- static schema: import("schemastery").Schema<unknown, any>;
9
- constructor(ctx: Context, config: AdapterConfig);
10
- prepare(): WebSocket;
6
+ static schema: import("schemastery")<unknown, any>;
7
+ prepare(bot: DiscordBot): WebSocket;
11
8
  heartbeat(bot: DiscordBot): void;
12
- private getIntents;
13
9
  accept(bot: DiscordBot): void;
14
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.0",
4
+ "version": "2.0.1",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -28,18 +28,18 @@
28
28
  "koishi"
29
29
  ],
30
30
  "peerDependencies": {
31
- "koishi": "^4.0.0"
31
+ "koishi": "^4.1.2"
32
32
  },
33
33
  "devDependencies": {
34
- "@koishijs/plugin-mock": "^1.0.0",
34
+ "@koishijs/plugin-mock": "^1.0.1",
35
35
  "@types/es-aggregate-error": "^1.0.2",
36
- "@types/ws": "^7.4.7",
37
- "axios": "^0.21.4"
36
+ "@types/ws": "^8.2.2",
37
+ "axios": "^0.24.0"
38
38
  },
39
39
  "dependencies": {
40
40
  "es-aggregate-error": "^1.0.7",
41
41
  "file-type": "^16.5.3",
42
42
  "form-data": "^4.0.0",
43
- "ws": "^8.2.1"
43
+ "ws": "^8.4.2"
44
44
  }
45
45
  }