@koishijs/plugin-adapter-discord 2.0.0-alpha.7 → 2.0.0-beta.3

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
@@ -1,36 +1,31 @@
1
1
  /// <reference types="koishi/lib" />
2
2
  /// <reference types="node" />
3
- import { Adapter, Bot, Schema, Requester } from 'koishi';
3
+ import { Adapter, Bot, Schema, Quester } from 'koishi';
4
4
  import { AdapterConfig } from './utils';
5
5
  import { Sender } from './sender';
6
- import * as DC from './types';
6
+ import * as Discord from './types';
7
7
  export interface BotConfig extends Bot.BaseConfig, Sender.Config {
8
8
  token: string;
9
9
  }
10
- export declare const BotConfig: Schema<BotConfig>;
10
+ export declare const BotConfig: Schema<unknown, any>;
11
11
  export declare class DiscordBot extends Bot<BotConfig> {
12
- static schema: Schema<AdapterConfig>;
12
+ static schema: Schema<AdapterConfig, AdapterConfig>;
13
13
  _d: number;
14
14
  _ping: NodeJS.Timeout;
15
15
  _sessionId: string;
16
- request: Requester;
16
+ http: Quester;
17
+ internal: Discord.Internal;
17
18
  constructor(adapter: Adapter, config: BotConfig);
18
19
  getSelf(): Promise<Bot.User>;
19
20
  private parseQuote;
20
21
  sendMessage(channelId: string, content: string, guildId?: string): Promise<string>;
21
22
  sendPrivateMessage(channelId: string, content: string): Promise<string>;
22
- deleteMessage(channelId: string, messageId: string): Promise<any>;
23
- editMessage(channelId: string, messageId: string, content: string): Promise<any>;
24
- $getMessage(channelId: string, messageId: string): Promise<DC.Message>;
23
+ deleteMessage(channelId: string, messageId: string): Promise<void>;
24
+ editMessage(channelId: string, messageId: string, content: string): Promise<void>;
25
25
  getMessage(channelId: string, messageId: string): Promise<Bot.Message>;
26
26
  getUser(userId: string): Promise<Bot.User>;
27
27
  getGuildMemberList(guildId: string): Promise<Bot.User[]>;
28
28
  getChannel(channelId: string): Promise<Bot.Channel>;
29
- $createReaction(channelId: string, messageId: string, emoji: string): Promise<void>;
30
- $deleteReaction(channelId: string, messageId: string, emoji: string, userId?: string): Promise<void>;
31
- $deleteAllReactions(channelId: string, messageId: string, emoji?: string): Promise<void>;
32
- $executeWebhook(id: string, token: string, data: DC.ExecuteWebhookBody, wait?: boolean): Promise<string>;
33
- $getGuildMember(guildId: string, userId: string): Promise<DC.GuildMember>;
34
29
  getGuildMember(guildId: string, userId: string): Promise<{
35
30
  nickname: string;
36
31
  userId: string;
@@ -39,34 +34,7 @@ export declare class DiscordBot extends Bot<BotConfig> {
39
34
  discriminator?: string;
40
35
  isBot?: boolean;
41
36
  }>;
42
- $getGuildRoles(guildId: string): Promise<DC.Role[]>;
43
- $getChannel(channelId: string): Promise<DC.Channel>;
44
- $listGuildMembers(guildId: string, limit?: number, after?: string): Promise<DC.GuildMember[]>;
45
- $getRoleMembers(guildId: string, roleId: string): Promise<DC.GuildMember[]>;
46
- $modifyGuildMember(guildId: string, userId: string, data: Partial<DC.ModifyGuildMember>): Promise<any>;
47
- $setGroupCard(guildId: string, userId: string, nick: string): Promise<any>;
48
- $addGuildMemberRole(guildId: string, userId: string, roleId: string): Promise<any>;
49
- $removeGuildMemberRole(guildId: string, userId: string, roleId: string): Promise<any>;
50
- $createGuildRole(guildId: string, data: DC.GuildRoleBody): Promise<any>;
51
- $modifyGuildRole(guildId: string, roleId: string, data: Partial<DC.GuildRoleBody>): Promise<any>;
52
- $modifyGuild(guildId: string, data: DC.GuildModify): Promise<any>;
53
- $setGroupName(guildId: string, name: string): Promise<any>;
54
- $createWebhook(channelId: string, data: {
55
- name: string;
56
- avatar?: string;
57
- }): Promise<any>;
58
- $modifyWebhook(webhookId: string, data: {
59
- name?: string;
60
- avatar?: string;
61
- channel_id?: string;
62
- }): Promise<any>;
63
- $getChannelWebhooks(channelId: string): Promise<DC.Webhook[]>;
64
- $getGuildWebhooks(guildId: string): Promise<DC.Webhook[]>;
65
- $modifyChannel(channelId: string, data: DC.ModifyChannel): Promise<any>;
66
- $getGuild(guildId: string): Promise<DC.Guild>;
67
37
  getGuild(guildId: string): Promise<Bot.Guild>;
68
- $getUserGuilds(): Promise<DC.PartialGuild[]>;
69
38
  getGuildList(): Promise<Bot.Guild[]>;
70
- $getGuildChannels(guildId: string): Promise<DC.Channel[]>;
71
39
  getChannelList(guildId: string): Promise<Bot.Channel[]>;
72
40
  }
package/lib/index.d.ts CHANGED
@@ -1,10 +1,19 @@
1
1
  /// <reference path="index.d.ts" />
2
2
  /// <reference types="koishi/lib" />
3
3
  import { Adapter } from 'koishi';
4
+ import * as Discord from './types';
5
+ export { Discord };
6
+ export * from './bot';
7
+ export * from './sender';
8
+ export * from './utils';
9
+ export * from './ws';
4
10
  declare module 'koishi' {
5
11
  interface Modules {
6
- 'adaper-discord': typeof import('.');
12
+ 'adapter-discord': typeof import('.');
13
+ }
14
+ interface Session {
15
+ discord?: Discord.GatewayPayload & Discord.Internal;
7
16
  }
8
17
  }
9
18
  declare const _default: import("koishi").Plugin.Object<Adapter.PluginConfig<import("./utils").AdapterConfig, import("./bot").BotConfig>>;
10
- export = _default;
19
+ export default _default;