@satorijs/adapter-discord 3.3.0 → 3.3.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.
@@ -1,6 +1,6 @@
1
- import { Dict, Modulator, Schema, segment } from '@satorijs/satori';
1
+ import { Dict, Messenger, Schema, segment } from '@satorijs/satori';
2
2
  import { DiscordBot } from './bot';
3
- export declare class DiscordModulator extends Modulator<DiscordBot> {
3
+ export declare class DiscordMessenger extends Messenger<DiscordBot> {
4
4
  private buffer;
5
5
  private addition;
6
6
  private figure;
@@ -12,7 +12,7 @@ export declare class DiscordModulator extends Modulator<DiscordBot> {
12
12
  flush(): Promise<void>;
13
13
  visit(element: segment): Promise<void>;
14
14
  }
15
- export declare namespace DiscordModulator {
15
+ export declare namespace DiscordMessenger {
16
16
  type HandleExternalAsset = 'auto' | 'download' | 'direct';
17
17
  type HandleMixedContent = 'auto' | 'separate' | 'attach';
18
18
  interface Config {
@@ -31,5 +31,5 @@ export declare namespace DiscordModulator {
31
31
  */
32
32
  handleMixedContent?: HandleMixedContent;
33
33
  }
34
- const Config: Schema<DiscordModulator.Config>;
34
+ const Config: Schema<DiscordMessenger.Config>;
35
35
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@satorijs/adapter-discord",
3
3
  "description": "Discord Adapter for Satorijs",
4
- "version": "3.3.0",
4
+ "version": "3.3.1",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -29,7 +29,7 @@
29
29
  "satori"
30
30
  ],
31
31
  "peerDependencies": {
32
- "@satorijs/satori": "^1.3.1"
32
+ "@satorijs/satori": "^1.3.5"
33
33
  },
34
34
  "dependencies": {
35
35
  "file-type": "^16.5.4",
package/lib/sender.d.ts DELETED
@@ -1,42 +0,0 @@
1
- import { Dict, Schema, segment } from '@satorijs/satori';
2
- import { DiscordBot } from './bot';
3
- export declare class Sender {
4
- private bot;
5
- private url;
6
- private results;
7
- private errors;
8
- private buffer;
9
- private addition;
10
- private figure;
11
- private mode;
12
- constructor(bot: DiscordBot, url: string);
13
- post(data?: any, headers?: any): Promise<void>;
14
- sendEmbed(fileBuffer: ArrayBuffer, payload_json: Dict, filename: string): Promise<void>;
15
- sendContent(content: string, addition: Dict): Promise<void>;
16
- sendAsset(type: string, data: Dict<string>, addition: Dict): Promise<void>;
17
- sendBuffer(): Promise<void>;
18
- render(elements: segment[]): Promise<void>;
19
- sendMessage(elements: segment[]): Promise<void>;
20
- send(content: string): Promise<string[]>;
21
- }
22
- export declare namespace Sender {
23
- type HandleExternalAsset = 'auto' | 'download' | 'direct';
24
- type HandleMixedContent = 'auto' | 'separate' | 'attach';
25
- interface Config {
26
- /**
27
- * 发送外链资源时采用的方式
28
- * - download:先下载后发送
29
- * - direct:直接发送链接
30
- * - auto:发送一个 HEAD 请求,如果返回的 Content-Type 正确,则直接发送链接,否则先下载后发送(默认)
31
- */
32
- handleExternalAsset?: HandleExternalAsset;
33
- /**
34
- * 发送图文等混合内容时采用的方式
35
- * - separate:将每个不同形式的内容分开发送
36
- * - attach:图片前如果有文本内容,则将文本作为图片的附带信息进行发送
37
- * - auto:如果图片本身采用直接发送则与前面的文本分开,否则将文本作为图片的附带信息发送(默认)
38
- */
39
- handleMixedContent?: HandleMixedContent;
40
- }
41
- const Config: Schema<Sender.Config>;
42
- }