@koishijs/plugin-adapter-discord 2.0.0-rc.0 → 2.0.2

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 CHANGED
@@ -2,10 +2,15 @@
2
2
  /// <reference types="node" />
3
3
  import { Adapter, Bot, Schema, Quester } from 'koishi';
4
4
  import { AdapterConfig } from './utils';
5
- import { Sender } from './sender';
6
- import * as Discord from './types';
7
- export interface BotConfig extends Bot.BaseConfig, Sender.Config {
5
+ import { Internal } from './types';
6
+ interface PrivilegedIntents {
7
+ members?: boolean;
8
+ presence?: boolean;
9
+ }
10
+ export interface BotConfig extends Bot.BaseConfig, Quester.Config {
8
11
  token: string;
12
+ gateway?: string;
13
+ intents?: PrivilegedIntents;
9
14
  }
10
15
  export declare const BotConfig: Schema<unknown, any>;
11
16
  export declare class DiscordBot extends Bot<BotConfig> {
@@ -14,12 +19,13 @@ export declare class DiscordBot extends Bot<BotConfig> {
14
19
  _ping: NodeJS.Timeout;
15
20
  _sessionId: string;
16
21
  http: Quester;
17
- internal: Discord.Internal;
22
+ internal: Internal;
18
23
  constructor(adapter: Adapter, config: BotConfig);
24
+ getIntents(): number;
19
25
  getSelf(): Promise<Bot.User>;
20
26
  private parseQuote;
21
- sendMessage(channelId: string, content: string, guildId?: string): Promise<string>;
22
- sendPrivateMessage(channelId: string, content: string): Promise<string>;
27
+ sendMessage(channelId: string, content: string, guildId?: string): Promise<string[]>;
28
+ sendPrivateMessage(channelId: string, content: string): Promise<string[]>;
23
29
  deleteMessage(channelId: string, messageId: string): Promise<void>;
24
30
  editMessage(channelId: string, messageId: string, content: string): Promise<void>;
25
31
  getMessage(channelId: string, messageId: string): Promise<Bot.Message>;
@@ -38,3 +44,4 @@ export declare class DiscordBot extends Bot<BotConfig> {
38
44
  getGuildList(): Promise<Bot.Guild[]>;
39
45
  getChannelList(guildId: string): Promise<Bot.Channel[]>;
40
46
  }
47
+ export {};
package/lib/index.d.ts CHANGED
@@ -8,9 +8,6 @@ export * from './sender';
8
8
  export * from './utils';
9
9
  export * from './ws';
10
10
  declare module 'koishi' {
11
- interface Modules {
12
- 'adapter-discord': typeof import('.');
13
- }
14
11
  interface Session {
15
12
  discord?: Discord.GatewayPayload & Discord.Internal;
16
13
  }