discord.js-selfv13 13.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of discord.js-selfv13 might be problematic. Click here for more details.

Files changed (188) hide show
  1. package/.dccache +1 -0
  2. package/LICENSE +190 -0
  3. package/README.md +87 -0
  4. package/browser.js +9 -0
  5. package/deploy/deploy-key.enc +0 -0
  6. package/deploy/deploy.sh +90 -0
  7. package/deploy/test.sh +34 -0
  8. package/docs/README.md +1 -0
  9. package/docs/examples/attachments.md +163 -0
  10. package/docs/examples/avatars.js +29 -0
  11. package/docs/examples/embed.js +38 -0
  12. package/docs/examples/greeting.js +30 -0
  13. package/docs/examples/moderation.md +145 -0
  14. package/docs/examples/ping.js +29 -0
  15. package/docs/examples/webhook.js +12 -0
  16. package/docs/general/faq.md +23 -0
  17. package/docs/general/updating.md +181 -0
  18. package/docs/general/welcome.md +95 -0
  19. package/docs/index.yml +30 -0
  20. package/docs/logo.svg +19 -0
  21. package/docs/topics/voice.md +113 -0
  22. package/docs/topics/web.md +38 -0
  23. package/package.json +147 -0
  24. package/src/client/Client.js +564 -0
  25. package/src/client/ClientDataManager.js +150 -0
  26. package/src/client/ClientDataResolver.js +376 -0
  27. package/src/client/ClientManager.js +74 -0
  28. package/src/client/WebhookClient.js +118 -0
  29. package/src/client/actions/Action.js +23 -0
  30. package/src/client/actions/ActionsManager.js +40 -0
  31. package/src/client/actions/ChannelCreate.js +11 -0
  32. package/src/client/actions/ChannelDelete.js +30 -0
  33. package/src/client/actions/ChannelUpdate.js +74 -0
  34. package/src/client/actions/GuildBanRemove.js +13 -0
  35. package/src/client/actions/GuildChannelsPositionUpdate.js +19 -0
  36. package/src/client/actions/GuildDelete.js +57 -0
  37. package/src/client/actions/GuildEmojiCreate.js +17 -0
  38. package/src/client/actions/GuildEmojiDelete.js +18 -0
  39. package/src/client/actions/GuildEmojiUpdate.js +17 -0
  40. package/src/client/actions/GuildEmojisUpdate.js +38 -0
  41. package/src/client/actions/GuildMemberGet.js +10 -0
  42. package/src/client/actions/GuildMemberRemove.js +41 -0
  43. package/src/client/actions/GuildRoleCreate.js +26 -0
  44. package/src/client/actions/GuildRoleDelete.js +42 -0
  45. package/src/client/actions/GuildRoleUpdate.js +41 -0
  46. package/src/client/actions/GuildRolesPositionUpdate.js +19 -0
  47. package/src/client/actions/GuildSync.js +29 -0
  48. package/src/client/actions/GuildUpdate.js +34 -0
  49. package/src/client/actions/MessageCreate.js +53 -0
  50. package/src/client/actions/MessageDelete.js +35 -0
  51. package/src/client/actions/MessageDeleteBulk.js +26 -0
  52. package/src/client/actions/MessageReactionAdd.js +37 -0
  53. package/src/client/actions/MessageReactionRemove.js +37 -0
  54. package/src/client/actions/MessageReactionRemoveAll.js +25 -0
  55. package/src/client/actions/MessageUpdate.js +40 -0
  56. package/src/client/actions/Ready.js +1 -0
  57. package/src/client/actions/Ready.js.bak +65 -0
  58. package/src/client/actions/UserGet.js +11 -0
  59. package/src/client/actions/UserNoteUpdate.js +30 -0
  60. package/src/client/actions/UserUpdate.js +33 -0
  61. package/src/client/rest/APIRequest.js +56 -0
  62. package/src/client/rest/DiscordAPIError.js +60 -0
  63. package/src/client/rest/RESTManager.js +58 -0
  64. package/src/client/rest/RESTMethods.js +1006 -0
  65. package/src/client/rest/RequestHandlers/Burst.js +90 -0
  66. package/src/client/rest/RequestHandlers/RequestHandler.js +54 -0
  67. package/src/client/rest/RequestHandlers/Sequential.js +132 -0
  68. package/src/client/rest/UserAgentManager.js +25 -0
  69. package/src/client/voice/ClientVoiceManager.js +81 -0
  70. package/src/client/voice/VoiceBroadcast.js +366 -0
  71. package/src/client/voice/VoiceConnection.js +530 -0
  72. package/src/client/voice/VoiceUDPClient.js +127 -0
  73. package/src/client/voice/VoiceWebSocket.js +246 -0
  74. package/src/client/voice/dispatcher/StreamDispatcher.js +331 -0
  75. package/src/client/voice/opus/BaseOpusEngine.js +60 -0
  76. package/src/client/voice/opus/NodeOpusEngine.js +40 -0
  77. package/src/client/voice/opus/OpusEngineList.js +28 -0
  78. package/src/client/voice/opus/OpusScriptEngine.js +45 -0
  79. package/src/client/voice/player/AudioPlayer.js +170 -0
  80. package/src/client/voice/receiver/VoiceReadable.js +17 -0
  81. package/src/client/voice/receiver/VoiceReceiver.js +219 -0
  82. package/src/client/voice/util/SecretKey.js +16 -0
  83. package/src/client/voice/util/Secretbox.js +33 -0
  84. package/src/client/voice/util/VolumeInterface.js +86 -0
  85. package/src/client/websocket/WebSocketConnection.js +506 -0
  86. package/src/client/websocket/WebSocketManager.js +90 -0
  87. package/src/client/websocket/packets/WebSocketPacketManager.js +110 -0
  88. package/src/client/websocket/packets/handlers/AbstractHandler.js +11 -0
  89. package/src/client/websocket/packets/handlers/ChannelCreate.js +17 -0
  90. package/src/client/websocket/packets/handlers/ChannelDelete.js +20 -0
  91. package/src/client/websocket/packets/handlers/ChannelPinsUpdate.js +37 -0
  92. package/src/client/websocket/packets/handlers/ChannelUpdate.js +11 -0
  93. package/src/client/websocket/packets/handlers/GuildBanAdd.js +23 -0
  94. package/src/client/websocket/packets/handlers/GuildBanRemove.js +20 -0
  95. package/src/client/websocket/packets/handlers/GuildCreate.js +22 -0
  96. package/src/client/websocket/packets/handlers/GuildDelete.js +19 -0
  97. package/src/client/websocket/packets/handlers/GuildEmojisUpdate.js +11 -0
  98. package/src/client/websocket/packets/handlers/GuildIntegrationsUpdate.js +19 -0
  99. package/src/client/websocket/packets/handlers/GuildMemberAdd.js +17 -0
  100. package/src/client/websocket/packets/handlers/GuildMemberRemove.js +13 -0
  101. package/src/client/websocket/packets/handlers/GuildMemberUpdate.js +18 -0
  102. package/src/client/websocket/packets/handlers/GuildMembersChunk.js +33 -0
  103. package/src/client/websocket/packets/handlers/GuildRoleCreate.js +11 -0
  104. package/src/client/websocket/packets/handlers/GuildRoleDelete.js +11 -0
  105. package/src/client/websocket/packets/handlers/GuildRoleUpdate.js +11 -0
  106. package/src/client/websocket/packets/handlers/GuildSync.js +11 -0
  107. package/src/client/websocket/packets/handlers/GuildUpdate.js +11 -0
  108. package/src/client/websocket/packets/handlers/MessageCreate.js +19 -0
  109. package/src/client/websocket/packets/handlers/MessageDelete.js +19 -0
  110. package/src/client/websocket/packets/handlers/MessageDeleteBulk.js +17 -0
  111. package/src/client/websocket/packets/handlers/MessageReactionAdd.js +11 -0
  112. package/src/client/websocket/packets/handlers/MessageReactionRemove.js +11 -0
  113. package/src/client/websocket/packets/handlers/MessageReactionRemoveAll.js +11 -0
  114. package/src/client/websocket/packets/handlers/MessageUpdate.js +11 -0
  115. package/src/client/websocket/packets/handlers/PresenceUpdate.js +76 -0
  116. package/src/client/websocket/packets/handlers/Ready.js +83 -0
  117. package/src/client/websocket/packets/handlers/RelationshipAdd.js +19 -0
  118. package/src/client/websocket/packets/handlers/RelationshipRemove.js +19 -0
  119. package/src/client/websocket/packets/handlers/Resumed.js +28 -0
  120. package/src/client/websocket/packets/handlers/TypingStart.js +68 -0
  121. package/src/client/websocket/packets/handlers/UserGuildSettingsUpdate.js +21 -0
  122. package/src/client/websocket/packets/handlers/UserNoteUpdate.js +12 -0
  123. package/src/client/websocket/packets/handlers/UserSettingsUpdate.js +18 -0
  124. package/src/client/websocket/packets/handlers/UserUpdate.js +11 -0
  125. package/src/client/websocket/packets/handlers/VoiceServerUpdate.js +19 -0
  126. package/src/client/websocket/packets/handlers/VoiceStateUpdate.js +52 -0
  127. package/src/client/websocket/packets/handlers/WebhooksUpdate.js +19 -0
  128. package/src/index.js +66 -0
  129. package/src/sharding/Shard.js +282 -0
  130. package/src/sharding/ShardClientUtil.js +146 -0
  131. package/src/sharding/ShardingManager.js +220 -0
  132. package/src/structures/Attachment.js +75 -0
  133. package/src/structures/CategoryChannel.js +22 -0
  134. package/src/structures/Channel.js +78 -0
  135. package/src/structures/ClientUser.js +447 -0
  136. package/src/structures/ClientUserChannelOverride.js +30 -0
  137. package/src/structures/ClientUserGuildSettings.js +60 -0
  138. package/src/structures/ClientUserSettings.js +80 -0
  139. package/src/structures/DMChannel.js +76 -0
  140. package/src/structures/Emoji.js +256 -0
  141. package/src/structures/GroupDMChannel.js +246 -0
  142. package/src/structures/Guild.js +1461 -0
  143. package/src/structures/GuildAuditLogs.js +371 -0
  144. package/src/structures/GuildChannel.js +537 -0
  145. package/src/structures/GuildMember.js +613 -0
  146. package/src/structures/Invite.js +164 -0
  147. package/src/structures/Message.js +605 -0
  148. package/src/structures/MessageAttachment.js +68 -0
  149. package/src/structures/MessageCollector.js +100 -0
  150. package/src/structures/MessageEmbed.js +386 -0
  151. package/src/structures/MessageMentions.js +144 -0
  152. package/src/structures/MessageReaction.js +96 -0
  153. package/src/structures/NewsChannel.js +24 -0
  154. package/src/structures/OAuth2Application.js +148 -0
  155. package/src/structures/PartialGuild.js +51 -0
  156. package/src/structures/PartialGuildChannel.js +44 -0
  157. package/src/structures/PermissionOverwrites.js +69 -0
  158. package/src/structures/Presence.js +241 -0
  159. package/src/structures/ReactionCollector.js +85 -0
  160. package/src/structures/ReactionEmoji.js +49 -0
  161. package/src/structures/RichEmbed.js +295 -0
  162. package/src/structures/Role.js +376 -0
  163. package/src/structures/StoreChannel.js +25 -0
  164. package/src/structures/TextChannel.js +154 -0
  165. package/src/structures/User.js +329 -0
  166. package/src/structures/UserConnection.js +48 -0
  167. package/src/structures/UserProfile.js +62 -0
  168. package/src/structures/VoiceChannel.js +146 -0
  169. package/src/structures/VoiceRegion.js +50 -0
  170. package/src/structures/Webhook.js +304 -0
  171. package/src/structures/interfaces/Collector.js +179 -0
  172. package/src/structures/interfaces/TextBasedChannel.js +635 -0
  173. package/src/structures/shared/resolvePermissions.js +26 -0
  174. package/src/util/Collection.js +532 -0
  175. package/src/util/Constants.js +845 -0
  176. package/src/util/Permissions.js +306 -0
  177. package/src/util/Snowflake.js +82 -0
  178. package/src/util/Util.js +221 -0
  179. package/test/random.js +207 -0
  180. package/test/shard.js +31 -0
  181. package/test/sharder.js +7 -0
  182. package/test/voice.js +78 -0
  183. package/test/webpack.html +31 -0
  184. package/tsconfig.json +13 -0
  185. package/tslint.json +62 -0
  186. package/typings/discord.js-test.ts +69 -0
  187. package/typings/index.d.ts +2190 -0
  188. package/webpack.config.js +62 -0
@@ -0,0 +1,2190 @@
1
+ // Type definitions for discord.js 11.5.0
2
+ // Project: https://github.com/discordjs/discord.js
3
+ // Definitions by:
4
+ // acdenisSK <acdenissk69@gmail.com> (https://github.com/acdenisSK)
5
+ // Zack Campbell <zajrik@gmail.com> (https://github.com/zajrik)
6
+ // License: MIT
7
+
8
+ declare module 'discord.js' {
9
+ import { EventEmitter } from 'events';
10
+ import { Stream, Readable as ReadableStream } from 'stream';
11
+ import { ChildProcess } from 'child_process';
12
+
13
+ export const version: string;
14
+
15
+ //#region Classes
16
+
17
+ class Attachment {
18
+ constructor(file: BufferResolvable | Stream, name?: string);
19
+ private _attach(file: BufferResolvable | Stream, name: string): void;
20
+
21
+ public readonly attachment: BufferResolvable | Stream;
22
+ public readonly name: string;
23
+ public setAttachment(file: BufferResolvable | Stream, name: string): this;
24
+ public setFile(attachment: BufferResolvable | Stream): this;
25
+ public setName(name: string): this;
26
+ }
27
+
28
+ class AudioPlayer extends EventEmitter {
29
+ constructor(voiceConnection: VoiceConnection);
30
+ public readonly dispatcher: StreamDispatcher;
31
+ public opusEncoder: object;
32
+ public prism: object;
33
+ public readonly transcoder: object;
34
+ public voiceConnection: VoiceConnection;
35
+ public setBitrate(value: number | 'auto'): void;
36
+ }
37
+
38
+ class BaseOpus {
39
+ constructor(options?: { bitrate?: number, fec?: boolean, plp?: number });
40
+ public bitrate: number;
41
+ public options: object;
42
+ }
43
+
44
+ export class CategoryChannel extends GuildChannel {
45
+ public readonly children: Collection<Snowflake, GuildChannel>;
46
+ }
47
+
48
+ export class Channel {
49
+ constructor(client: Client, data: object);
50
+ public readonly client: Client;
51
+ public readonly createdAt: Date;
52
+ public readonly createdTimestamp: number;
53
+ public id: Snowflake;
54
+ public type: 'dm' | 'group' | 'text' | 'voice' | 'category' | 'news' | 'store';
55
+ public delete(): Promise<Channel>;
56
+ }
57
+
58
+ export class Client extends EventEmitter {
59
+ constructor(options?: ClientOptions);
60
+ private _intervals: Set<NodeJS.Timer>;
61
+ private _pingTimestamp: number;
62
+ private _timeouts: Set<NodeJS.Timer>;
63
+ private actions: object;
64
+ private dataManager: object;
65
+ private manager: ClientManager;
66
+ private resolver: ClientDataResolver;
67
+ private rest: object;
68
+ private voice: ClientVoiceManager;
69
+ private ws: object;
70
+ private _eval(script: string): any;
71
+ private _pong(startTime: number): void;
72
+ private _setPresence(id: Snowflake, presence: object): void;
73
+ private _validateOptions(options?: ClientOptions): void;
74
+
75
+ public broadcasts: VoiceBroadcast[];
76
+ public readonly browser: boolean;
77
+ public channels: Collection<Snowflake, Channel>;
78
+ public readonly emojis: Collection<Snowflake, Emoji>;
79
+ public guilds: Collection<Snowflake, Guild>;
80
+ public options: ClientOptions;
81
+ public readonly ping: number;
82
+ public pings: number[];
83
+ public presences: Collection<Snowflake, Presence>;
84
+ public readyAt: Date;
85
+ public readonly readyTimestamp: number;
86
+ public shard: ShardClientUtil;
87
+ public readonly status: number;
88
+ public token: string;
89
+ public readonly uptime: number;
90
+ public user: ClientUser;
91
+ public users: Collection<Snowflake, User>;
92
+ public readonly voiceConnections: Collection<Snowflake, VoiceConnection>;
93
+ public clearInterval(interval: NodeJS.Timer): void;
94
+ public clearTimeout(timeout: NodeJS.Timer): void;
95
+ public createVoiceBroadcast(): VoiceBroadcast;
96
+ public destroy(): Promise<void>;
97
+ public fetchApplication(id?: Snowflake): Promise<OAuth2Application>;
98
+ public fetchInvite(invite: InviteResolvable): Promise<Invite>;
99
+ public fetchUser(id: Snowflake, cache?: boolean): Promise<User>;
100
+ public fetchVoiceRegions(): Promise<Collection<string, VoiceRegion>>;
101
+ public fetchWebhook(id: Snowflake, token?: string): Promise<Webhook>;
102
+ public generateInvite(permissions?: PermissionResolvable): Promise<string>;
103
+ public login(token?: string): Promise<string>;
104
+ public setInterval(fn: Function, delay: number, ...args: any[]): NodeJS.Timer;
105
+ public setTimeout(fn: Function, delay: number, ...args: any[]): NodeJS.Timer;
106
+ public sweepMessages(lifetime?: number): number;
107
+ public syncGuilds(guilds?: Guild[] | Collection<Snowflake, Guild>): void;
108
+
109
+ public on(event: 'channelCreate', listener: (channel: Channel) => void): this;
110
+ public on(event: 'channelDelete', listener: (channel: Channel) => void): this;
111
+ public on(event: 'channelPinsUpdate', listener: (channel: Channel, time: Date) => void): this;
112
+ public on(event: 'channelUpdate', listener: (oldChannel: Channel, newChannel: Channel) => void): this;
113
+ public on(event: 'clientUserGuildSettingsUpdate', listener: (clientUserGuildSettings: ClientUserGuildSettings) => void): this;
114
+ public on(event: 'clientUserSettingsUpdate', listener: (clientUserSettings: ClientUserSettings) => void): this;
115
+ public on(event: 'debug', listener: (info: string) => void): this;
116
+ public on(event: 'disconnect', listener: (event: any) => void): this;
117
+ public on(event: 'emojiCreate', listener: (emoji: Emoji) => void): this;
118
+ public on(event: 'emojiDelete', listener: (emoji: Emoji) => void): this;
119
+ public on(event: 'emojiUpdate', listener: (oldEmoji: Emoji, newEmoji: Emoji) => void): this;
120
+ public on(event: 'error', listener: (error: Error) => void): this;
121
+ public on(event: 'guildBanAdd', listener: (guild: Guild, user: User) => void): this;
122
+ public on(event: 'guildBanRemove', listener: (guild: Guild, user: User) => void): this;
123
+ public on(event: 'guildCreate', listener: (guild: Guild) => void): this;
124
+ public on(event: 'guildDelete', listener: (guild: Guild) => void): this;
125
+ public on(event: 'guildMemberAdd', listener: (member: GuildMember) => void): this;
126
+ public on(event: 'guildMemberAvailable', listener: (member: GuildMember) => void): this;
127
+ public on(event: 'guildMemberRemove', listener: (member: GuildMember) => void): this;
128
+ public on(event: 'guildMembersChunk', listener: (members: GuildMember[], guild: Guild) => void): this;
129
+ public on(event: 'guildMemberSpeaking', listener: (member: GuildMember, speaking: boolean) => void): this;
130
+ public on(event: 'guildMemberUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this;
131
+ public on(event: 'guildUnavailable', listener: (guild: Guild) => void): this;
132
+ public on(event: 'guildUpdate', listener: (oldGuild: Guild, newGuild: Guild) => void): this;
133
+ public on(event: 'guildIntegrationsUpdate', listener: (guild: Guild) => void): this;
134
+ public on(event: 'message', listener: (message: Message) => void): this;
135
+ public on(event: 'messageDelete', listener: (message: Message) => void): this;
136
+ public on(event: 'messageDeleteBulk', listener: (messages: Collection<Snowflake, Message>) => void): this;
137
+ public on(event: 'messageReactionAdd', listener: (messageReaction: MessageReaction, user: User) => void): this;
138
+ public on(event: 'messageReactionRemove', listener: (messageReaction: MessageReaction, user: User) => void): this;
139
+ public on(event: 'messageReactionRemoveAll', listener: (message: Message) => void): this;
140
+ public on(event: 'messageUpdate', listener: (oldMessage: Message, newMessage: Message) => void): this;
141
+ public on(event: 'presenceUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this;
142
+ public on(event: 'rateLimit', listener: (rateLimit: RateLimitInfo) => void): this;
143
+ public on(event: 'ready', listener: () => void): this;
144
+ public on(event: 'reconnecting', listener: () => void): this;
145
+ public on(event: 'resume', listener: (replayed: number) => void): this;
146
+ public on(event: 'roleCreate', listener: (role: Role) => void): this;
147
+ public on(event: 'roleDelete', listener: (role: Role) => void): this;
148
+ public on(event: 'roleUpdate', listener: (oldRole: Role, newRole: Role) => void): this;
149
+ public on(event: 'typingStart', listener: (channel: Channel, user: User) => void): this;
150
+ public on(event: 'typingStop', listener: (channel: Channel, user: User) => void): this;
151
+ public on(event: 'userNoteUpdate', listener: (user: UserResolvable, oldNote: string, newNote: string) => void): this;
152
+ public on(event: 'userUpdate', listener: (oldUser: User, newUser: User) => void): this;
153
+ public on(event: 'voiceStateUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this;
154
+ public on(event: 'warn', listener: (info: string) => void): this;
155
+ public on(event: 'webhookUpdate', listener: (channel: TextChannel) => void): this;
156
+ public on(event: string, listener: Function): this;
157
+
158
+ public once(event: 'channelCreate', listener: (channel: Channel) => void): this;
159
+ public once(event: 'channelDelete', listener: (channel: Channel) => void): this;
160
+ public once(event: 'channelPinsUpdate', listener: (channel: Channel, time: Date) => void): this;
161
+ public once(event: 'channelUpdate', listener: (oldChannel: Channel, newChannel: Channel) => void): this;
162
+ public once(event: 'clientUserGuildSettingsUpdate', listener: (clientUserGuildSettings: ClientUserGuildSettings) => void): this;
163
+ public once(event: 'clientUserSettingsUpdate', listener: (clientUserSettings: ClientUserSettings) => void): this;
164
+ public once(event: 'debug', listener: (info: string) => void): this;
165
+ public once(event: 'disconnect', listener: (event: any) => void): this;
166
+ public once(event: 'emojiCreate', listener: (emoji: Emoji) => void): this;
167
+ public once(event: 'emojiDelete', listener: (emoji: Emoji) => void): this;
168
+ public once(event: 'emojiUpdate', listener: (oldEmoji: Emoji, newEmoji: Emoji) => void): this;
169
+ public once(event: 'error', listener: (error: Error) => void): this;
170
+ public once(event: 'guildBanAdd', listener: (guild: Guild, user: User) => void): this;
171
+ public once(event: 'guildBanRemove', listener: (guild: Guild, user: User) => void): this;
172
+ public once(event: 'guildCreate', listener: (guild: Guild) => void): this;
173
+ public once(event: 'guildDelete', listener: (guild: Guild) => void): this;
174
+ public once(event: 'guildMemberAdd', listener: (member: GuildMember) => void): this;
175
+ public once(event: 'guildMemberAvailable', listener: (member: GuildMember) => void): this;
176
+ public once(event: 'guildMemberRemove', listener: (member: GuildMember) => void): this;
177
+ public once(event: 'guildMembersChunk', listener: (members: GuildMember[], guild: Guild) => void): this;
178
+ public once(event: 'guildMemberSpeaking', listener: (member: GuildMember, speaking: boolean) => void): this;
179
+ public once(event: 'guildMemberUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this;
180
+ public once(event: 'guildUnavailable', listener: (guild: Guild) => void): this;
181
+ public once(event: 'guildUpdate', listener: (oldGuild: Guild, newGuild: Guild) => void): this;
182
+ public once(event: 'guildIntegrationsUpdate', listener: (guild: Guild) => void): this;
183
+ public once(event: 'message', listener: (message: Message) => void): this;
184
+ public once(event: 'messageDelete', listener: (message: Message) => void): this;
185
+ public once(event: 'messageDeleteBulk', listener: (messages: Collection<Snowflake, Message>) => void): this;
186
+ public once(event: 'messageReactionAdd', listener: (messageReaction: MessageReaction, user: User) => void): this;
187
+ public once(event: 'messageReactionRemove', listener: (messageReaction: MessageReaction, user: User) => void): this;
188
+ public once(event: 'messageReactionRemoveAll', listener: (message: Message) => void): this;
189
+ public once(event: 'messageUpdate', listener: (oldMessage: Message, newMessage: Message) => void): this;
190
+ public once(event: 'presenceUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this;
191
+ public once(event: 'rateLimit', listener: (rateLimit: RateLimitInfo) => void): this;
192
+ public once(event: 'ready', listener: () => void): this;
193
+ public once(event: 'reconnecting', listener: () => void): this;
194
+ public once(event: 'resume', listener: (replayed: number) => void): this;
195
+ public once(event: 'roleCreate', listener: (role: Role) => void): this;
196
+ public once(event: 'roleDelete', listener: (role: Role) => void): this;
197
+ public once(event: 'roleUpdate', listener: (oldRole: Role, newRole: Role) => void): this;
198
+ public once(event: 'typingStart', listener: (channel: Channel, user: User) => void): this;
199
+ public once(event: 'typingStop', listener: (channel: Channel, user: User) => void): this;
200
+ public once(event: 'userNoteUpdate', listener: (user: UserResolvable, oldNote: string, newNote: string) => void): this;
201
+ public once(event: 'userUpdate', listener: (oldUser: User, newUser: User) => void): this;
202
+ public once(event: 'voiceStateUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this;
203
+ public once(event: 'warn', listener: (info: string) => void): this;
204
+ public once(event: 'webhookUpdate', listener: (channel: TextChannel) => void): this;
205
+ public once(event: string, listener: Function): this;
206
+ }
207
+
208
+ class ClientDataResolver {
209
+ constructor(client: Client);
210
+ public resolveBase64(data: Base64Resolvable): string;
211
+ public resolveChannel(channel: ChannelResolvable): Channel;
212
+ public resolveChannelID(channel: ChannelResolvable): Snowflake;
213
+ public resolveColor(color: ColorResolvable): number;
214
+ public resolveEmojiIdentifier(emoji: EmojiIdentifierResolvable): string;
215
+ public resolveFile(resource: BufferResolvable | Stream): Promise<Buffer>;
216
+ public resolveGuild(guild: GuildResolvable): Guild;
217
+ public resolveGuildMember(guild: GuildResolvable, user: UserResolvable): GuildMember;
218
+ public resolveImage(imge: BufferResolvable | Base64Resolvable): Promise<string>;
219
+ public resolveInviteCode(data: InviteResolvable): string;
220
+ public resolveString(data: StringResolvable): string;
221
+ public resolveUser(user: UserResolvable): User;
222
+ public resolveUserID(user: UserResolvable): Snowflake;
223
+
224
+ public static resolveColor(color: ColorResolvable): number;
225
+ }
226
+
227
+ class ClientManager {
228
+ constructor(client: Client);
229
+ public client: Client;
230
+ public heartbeatInterval: number;
231
+ public status: number;
232
+ public connectToWebSocket(token: string, resolve: Function, reject: Function): void;
233
+ }
234
+
235
+ export class ClientUser extends User {
236
+ public blocked: Collection<Snowflake, User>;
237
+ public email: string;
238
+ public friends: Collection<Snowflake, User>;
239
+ public guildSettings: Collection<Snowflake, ClientUserGuildSettings>;
240
+ public mfaEnabled: boolean;
241
+ public mobile: boolean;
242
+ public notes: Collection<Snowflake, string>;
243
+ public premium: boolean;
244
+ public settings: ClientUserSettings;
245
+ public verified: boolean;
246
+ public acceptInvite(invite: Invite | string): Promise<Guild>;
247
+ public addFriend(user?: UserResolvable): Promise<User>;
248
+ public createGroupDM(recipients: GroupDMRecipientOptions[]): Promise<GroupDMChannel>;
249
+ public createGuild(name: string, region: string, icon?: BufferResolvable | Base64Resolvable): Promise<Guild>;
250
+ public fetchMentions(options?: { limit?: number; roles?: boolean, everyone?: boolean; guild?: Guild | Snowflake }): Promise<Message[]>;
251
+ public removeFriend(user?: UserResolvable): Promise<User>;
252
+ public setActivity(name: string | null, options?: { url?: string, type?: ActivityType | number }): Promise<Presence>;
253
+ public setAFK(afk: boolean): Promise<ClientUser>;
254
+ public setAvatar(avatar: BufferResolvable | Base64Resolvable): Promise<ClientUser>;
255
+ public setEmail(email: string, password: string): Promise<ClientUser>;
256
+ public setGame(game: string | null, streamingURL?: string): Promise<ClientUser>;
257
+ public setPassword(newPassword: string, oldPassword: string): Promise<ClientUser>;
258
+ public setPresence(data: PresenceData): Promise<ClientUser>;
259
+ public setStatus(status: PresenceStatus): Promise<ClientUser>;
260
+ public setUsername(username: string, password?: string): Promise<ClientUser>;
261
+ }
262
+
263
+ class ClientUserChannelOverride {
264
+ constructor(user: User, data: object);
265
+ private patch(data: object): void;
266
+
267
+ public messageNotifications: GuildChannelMessageNotifications;
268
+ public muted: boolean;
269
+ }
270
+
271
+ class ClientUserGuildSettings {
272
+ constructor(data: object, guild: Guild);
273
+ private patch(data: object): void;
274
+
275
+ public channelOverrides: Collection<Snowflake, ClientUserChannelOverride>;
276
+ public readonly client: Client;
277
+ public guildID: Snowflake;
278
+ public messageNotifications: GuildChannelMessageNotifications;
279
+ public mobilePush: boolean;
280
+ public muted: boolean;
281
+ public suppressEveryone: boolean;
282
+ public update(name: string, value: any): Promise<object>;
283
+ }
284
+
285
+ export class ClientUserSettings {
286
+ constructor(user: User, data: object);
287
+ private patch(data: object): void;
288
+
289
+ public convertEmoticons: boolean;
290
+ public defaultGuildsRestricted: boolean;
291
+ public detectPlatformAccounts: boolean;
292
+ public developerMode: boolean;
293
+ public enableTTSCommand: boolean;
294
+ public explicitContentFilter: 'DISABLED' | 'NON_FRIENDS' | 'FRIENDS_AND_NON_FRIENDS' | string;
295
+ public friendsSources: { all: boolean, mutualGuilds: boolean, mutualFriends: boolean };
296
+ public guildsPositions: Snowflake[];
297
+ public inlineAttachmentMedia: boolean;
298
+ public inlineEmbedMedia: boolean;
299
+ public locale: string;
300
+ public messageDisplayCompact: boolean;
301
+ public renderReactions: boolean;
302
+ public restrictedGuilds: Snowflake[];
303
+ public showCurrentGame: boolean;
304
+ public status: PresenceStatus;
305
+ public theme: string;
306
+ public addRestrictedGuild(guild: Guild): Promise<Guild>;
307
+ public removeRestrictedGuild(guild: Guild): Promise<Guild>;
308
+ public setGuildPosition(guild: Guild, position: number, relative?: boolean): Promise<Guild>;
309
+ public update(name: string, value: any): Promise<object>;
310
+ }
311
+
312
+ class ClientVoiceManager {
313
+ constructor(client: Client);
314
+ public client: Client;
315
+ public connections: Collection<Snowflake, VoiceConnection>;
316
+ public joinChannel(channel: VoiceChannel): Promise<VoiceConnection>;
317
+ }
318
+
319
+ export class Collection<K, V> extends Map<K, V> {
320
+ private _array: V[];
321
+ private _keyArray: K[];
322
+
323
+ public array(): V[];
324
+ public clone(): Collection<K, V>;
325
+ public concat(...collections: Collection<K, V>[]): Collection<K, V>;
326
+ public deleteAll(): Promise<V>[];
327
+ public equals(collection: Collection<any, any>): boolean;
328
+ public every(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): boolean;
329
+ public exists(prop: keyof V, value: any): boolean;
330
+ public filter(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): Collection<K, V>;
331
+ public filterArray(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): V[];
332
+ public find(prop: keyof V, value: any): V;
333
+ public find(fn: (value: V, key: K, collection: Collection<K, V>) => boolean): V;
334
+ public findAll(prop: keyof V, value: any): V[];
335
+ public findKey(prop: keyof V, value: any): K;
336
+ public findKey(fn: (value: V, key: K, collection: Collection<K, V>) => boolean): K;
337
+ public first(): V;
338
+ public first(count: number): V[];
339
+ public firstKey(): K;
340
+ public firstKey(count: number): K[];
341
+ public keyArray(): K[];
342
+ public last(): V;
343
+ public last(count: number): V[];
344
+ public lastKey(): K;
345
+ public lastKey(count: number): K[];
346
+ public map<T>(fn: (value: V, key: K, collection: Collection<K, V>) => T, thisArg?: any): T[];
347
+ public partition(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): [Collection<K, V>, Collection<K, V>];
348
+ public random(): V;
349
+ public random(count: number): V[];
350
+ public randomKey(): K;
351
+ public randomKey(count: number): K[];
352
+ public reduce<T>(fn: (accumulator: any, value: V, key: K, collection: Collection<K, V>) => T, initialValue?: any): T;
353
+ public some(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): boolean;
354
+ public sort(compareFunction?: (a: V, b: V, c?: K, d?: K) => number): Collection<K, V>;
355
+ public sweep(fn: (value: V, key: K, collection: Collection<K, V>) => boolean, thisArg?: any): number;
356
+ public tap(fn: (value: V, key: K, map: Collection<K, V>) => void, thisArg?: any): Collection<K, V>;
357
+ }
358
+
359
+ abstract class Collector<K, V> extends EventEmitter {
360
+ constructor(client: Client, filter: CollectorFilter, options?: CollectorOptions);
361
+ private _timeout: NodeJS.Timer;
362
+ private _handle(...args: any[]): void;
363
+
364
+ public readonly client: Client;
365
+ public collected: Collection<K, V>;
366
+ public ended: boolean;
367
+ public filter: CollectorFilter;
368
+ public readonly next: Promise<V>;
369
+ public options: CollectorOptions;
370
+ public stop(reason?: string): void;
371
+
372
+ protected listener: Function;
373
+ public abstract cleanup(): void;
374
+ public abstract handle(...args: any[]): CollectorHandler<K, V>;
375
+ public abstract postCheck(...args: any[]): string | null;
376
+
377
+ public on(event: 'collect', listener: (element: V, collector: Collector<K, V>) => void): this;
378
+ public on(event: 'end', listener: (collected: Collection<K, V>, reason: string) => void): this;
379
+ public on(event: string, listener: Function): this;
380
+
381
+ public once(event: 'collect', listener: (element: V, collector: Collector<K, V>) => void): this;
382
+ public once(event: 'end', listener: (collected: Collection<K, V>, reason: string) => void): this;
383
+ public once(event: string, listener: Function): this;
384
+ }
385
+
386
+ class DiscordAPIError extends Error {
387
+ constructor(error: object);
388
+ private static flattenErrors(obj: object, key: string): string[];
389
+
390
+ public code: number;
391
+ public method: string;
392
+ public path: string;
393
+ }
394
+
395
+ export class DMChannel extends TextBasedChannel(Channel) {
396
+ constructor(client: Client, data: object);
397
+ public lastMessageID: Snowflake;
398
+ public messages: Collection<Snowflake, Message>;
399
+ public recipient: User;
400
+ public toString(): string;
401
+ }
402
+
403
+ export class Emoji {
404
+ constructor(guild: Guild, data: object);
405
+ public animated: boolean;
406
+ public readonly client: Client;
407
+ public readonly createdAt: Date;
408
+ public readonly createdTimestamp: number;
409
+ public readonly deletable: boolean;
410
+ public guild: Guild;
411
+ public id: Snowflake;
412
+ public readonly identifier: string;
413
+ public managed: boolean;
414
+ public name: string;
415
+ public requiresColons: boolean;
416
+ public readonly roles: Collection<Snowflake, Role>;
417
+ public readonly url: string;
418
+ public addRestrictedRole(role: Role): Promise<Emoji>;
419
+ public addRestrictedRoles(roles: Role[]): Promise<Emoji>;
420
+ public edit(data: EmojiEditData, reason?: string): Promise<Emoji>;
421
+ public equals(other: Emoji | object): boolean;
422
+ public fetchAuthor(): Promise<User>;
423
+ public removeRestrictedRole(role: Role): Promise<Emoji>;
424
+ public removeRestrictedRoles(roles: Role[]): Promise<Emoji>;
425
+ public setName(name: string, reason?: string): Promise<Emoji>;
426
+ public toString(): string;
427
+ }
428
+
429
+ export class Game {
430
+ constructor(data: object, presence: Presence);
431
+ public applicationID: string;
432
+ public assets: RichPresenceAssets;
433
+ public details: string;
434
+ public name: string;
435
+ public readonly streaming: boolean;
436
+ public party: {
437
+ id: string;
438
+ size: [number, number];
439
+ };
440
+ public state: string;
441
+ public timestamps: {
442
+ start: Date;
443
+ end: Date;
444
+ };
445
+ public readonly flags: string[];
446
+ public type: number;
447
+ public url: string;
448
+ public equals(game: Game): boolean;
449
+ public toString(): string;
450
+ private _flags: string[];
451
+ private syncID: string;
452
+ }
453
+
454
+ export class GroupDMChannel extends TextBasedChannel(Channel) {
455
+ constructor(client: Client, data: object);
456
+ public applicationID: string;
457
+ public icon: string;
458
+ public lastMessageID: string;
459
+ public managed: boolean;
460
+ public messages: Collection<Snowflake, Message>;
461
+ public name: string;
462
+ public nicks: Collection<Snowflake, string>;
463
+ public readonly owner: User;
464
+ public ownerID: string;
465
+ public recipients: Collection<Snowflake, User>;
466
+ public addUser(accessTokenOrID: UserResolvable | string, nick?: string): Promise<GroupDMChannel>;
467
+ public equals(channel: GroupDMChannel): boolean;
468
+ public setIcon(icon: Base64Resolvable | BufferResolvable): Promise<GroupDMChannel>;
469
+ public toString(): string;
470
+ }
471
+
472
+ export class Guild {
473
+ constructor(client: Client, data: object);
474
+ private readonly _sortedRoles: Collection<Snowflake, Role>;
475
+ private _sortedChannels(type: string): Collection<Snowflake, GuildChannel>;
476
+ private _sortPositionWithID(collection: Collection<any, any>): Collection<any, any>;
477
+
478
+ protected setup(data: any): void;
479
+
480
+ public readonly afkChannel: VoiceChannel;
481
+ public afkChannelID: string;
482
+ public afkTimeout: number;
483
+ public applicationID: string;
484
+ public available: boolean;
485
+ public channels: Collection<Snowflake, GuildChannel>;
486
+ public defaultMessageNotifications: DefaultMessageNotifications | number;
487
+ public readonly client: Client;
488
+ public readonly createdAt: Date;
489
+ public readonly createdTimestamp: number;
490
+ public readonly defaultChannel: TextChannel;
491
+ public readonly defaultRole: Role;
492
+ public embedEnabled: boolean;
493
+ public emojis: Collection<Snowflake, Emoji>;
494
+ public explicitContentFilter: number;
495
+ public features: string[];
496
+ public icon: string;
497
+ public readonly iconURL: string;
498
+ public id: Snowflake;
499
+ public readonly joinedAt: Date;
500
+ public joinedTimestamp: number;
501
+ public large: boolean;
502
+ public readonly me: GuildMember;
503
+ public memberCount: number;
504
+ public members: Collection<Snowflake, GuildMember>;
505
+ public readonly messageNotifications: MessageNotifications;
506
+ public readonly mobilePush: boolean;
507
+ public readonly muted: boolean;
508
+ public name: string;
509
+ public readonly nameAcronym: string;
510
+ public readonly owner: GuildMember;
511
+ public ownerID: string;
512
+ public readonly position: number;
513
+ public presences: Collection<Snowflake, Presence>;
514
+ public region: string;
515
+ public roles: Collection<Snowflake, Role>;
516
+ public splash: string;
517
+ public readonly splashURL: string;
518
+ public readonly suppressEveryone: boolean;
519
+ public readonly systemChannel: GuildChannel;
520
+ public systemChannelID: Snowflake;
521
+ public readonly verified: boolean;
522
+ public verificationLevel: number;
523
+ public readonly voiceConnection: VoiceConnection;
524
+ public acknowledge(): Promise<Guild>;
525
+ public addMember(user: UserResolvable, options: AddGuildMemberOptions): Promise<GuildMember>;
526
+ public allowDMs(allow: boolean): Promise<Guild>;
527
+ public ban(user: UserResolvable, options?: BanOptions | number | string): Promise<GuildMember | User | string>;
528
+ public createChannel(name: string, options?: ChannelData): Promise<CategoryChannel | TextChannel | VoiceChannel>;
529
+ public createChannel(name: string, type?: 'category' | 'text' | 'voice' | 'news' | 'store', permissionOverwrites?: PermissionOverwrites[] | ChannelCreationOverwrites[], reason?: string): Promise<CategoryChannel | TextChannel | VoiceChannel>;
530
+ public createEmoji(attachment: BufferResolvable | Base64Resolvable, name: string, roles?: Collection<Snowflake, Role> | Role[], reason?: string): Promise<Emoji>;
531
+ public createRole(data?: RoleData, reason?: string): Promise<Role>;
532
+ public delete(): Promise<Guild>;
533
+ public deleteEmoji(emoji: Emoji | string, reason?: string): Promise<void>;
534
+ public edit(data: GuildEditData, reason?: string): Promise<Guild>;
535
+ public equals(guild: Guild): boolean;
536
+ public fetchAuditLogs(options?: GuildAuditLogsFetchOptions): Promise<GuildAuditLogs>;
537
+ public fetchBan(user: UserResolvable): Promise<BanInfo>;
538
+ public fetchBans(withReasons?: false): Promise<Collection<Snowflake, User>>;
539
+ public fetchBans(withReasons: true): Promise<Collection<Snowflake, BanInfo>>;
540
+ public fetchBans(withReasons: boolean): Promise<Collection<Snowflake, BanInfo | User>>;
541
+ public fetchEmbed(): Promise<GuildEmbedData>;
542
+ public fetchInvites(): Promise<Collection<Snowflake, Invite>>;
543
+ public fetchMember(user: UserResolvable, cache?: boolean): Promise<GuildMember>;
544
+ public fetchMembers(query?: string, limit?: number): Promise<Guild>;
545
+ public fetchVanityCode(): Promise<string>;
546
+ public fetchVoiceRegions(): Promise<Collection<string, VoiceRegion>>;
547
+ public fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>;
548
+ public leave(): Promise<Guild>;
549
+ public member(user: UserResolvable): GuildMember;
550
+ public pruneMembers(days: number, dry?: boolean, reason?: string): Promise<number>;
551
+ public search(options?: MessageSearchOptions): Promise<MessageSearchResult>;
552
+ public setAFKChannel(afkChannel: ChannelResolvable, reason?: string): Promise<Guild>;
553
+ public setAFKTimeout(afkTimeout: number, reason?: string): Promise<Guild>;
554
+ public setChannelPosition(channel: string | GuildChannel, position: number, relative?: boolean): Promise<Guild>;
555
+ public setChannelPositions(channelPositions: ChannelPosition[]): Promise<Guild>;
556
+ public setDefaultMessageNotifications(defaultMessageNotifications: DefaultMessageNotifications, reason: string): Promise<Guild>;
557
+ public setEmbed(embed: GuildEmbedData, reason?: string): Promise<Guild>;
558
+ public setExplicitContentFilter(explicitContentFilter: number, reason?: string): Promise<Guild>;
559
+ public setIcon(icon: Base64Resolvable, reason?: string): Promise<Guild>;
560
+ public setName(name: string, reason?: string): Promise<Guild>;
561
+ public setOwner(owner: GuildMemberResolvable, reason?: string): Promise<Guild>;
562
+ public setPosition(position: number, relative?: boolean): Promise<Guild>;
563
+ public setRegion(region: string, reason?: string): Promise<Guild>;
564
+ public setRolePosition(role: string | Role, position: number, relative?: boolean): Promise<Guild>;
565
+ public setSplash(splash: Base64Resolvable, reason?: string): Promise<Guild>;
566
+ public setSystemChannel(systemChannel: ChannelResolvable, reason?: string): Promise<Guild>;
567
+ public setVerificationLevel(verificationLevel: number, reason?: string): Promise<Guild>;
568
+ public sync(): void;
569
+ public toString(): string;
570
+ public unban(user: UserResolvable, reason?: string): Promise<User>;
571
+ }
572
+
573
+ export class GuildAuditLogs {
574
+ constructor(guild: Guild, data: object);
575
+ private webhooks: Collection<Snowflake, Webhook>;
576
+
577
+ public entries: Collection<Snowflake, GuildAuditLogsEntry>;
578
+
579
+ public static Actions: GuildAuditLogsActions;
580
+ public static Targets: GuildAuditLogsTargets;
581
+ public static Entry: typeof GuildAuditLogsEntry;
582
+ public static actionType(action: number): GuildAuditLogsActionType;
583
+ public static build(...args: any[]): Promise<GuildAuditLogs>;
584
+ public static targetType(target: number): GuildAuditLogsTarget;
585
+ }
586
+
587
+ class GuildAuditLogsEntry {
588
+ constructor(logs: GuildAuditLogs, guild: Guild, data: object);
589
+ public action: GuildAuditLogsAction;
590
+ public actionType: GuildAuditLogsActionType;
591
+ public changes: AuditLogChange[];
592
+ public readonly createdAt: Date;
593
+ public readonly createdTimestamp: number;
594
+ public executor: User;
595
+ public extra: object | Role | GuildMember;
596
+ public id: Snowflake;
597
+ public reason: string;
598
+ public target: Guild | User | Role | Emoji | Invite | Webhook;
599
+ public targetType: GuildAuditLogsTarget;
600
+ }
601
+
602
+ export class GuildChannel extends Channel {
603
+ constructor(guild: Guild, data: object);
604
+ public readonly calculatedPosition: number;
605
+ public readonly deletable: boolean;
606
+ public guild: Guild;
607
+ public readonly manageable: boolean;
608
+ public readonly messageNotifications: GuildChannelMessageNotifications;
609
+ public readonly muted: boolean;
610
+ public name: string;
611
+ public readonly parent: CategoryChannel;
612
+ public parentID: Snowflake;
613
+ public permissionOverwrites: Collection<Snowflake, PermissionOverwrites>;
614
+ public position: number;
615
+ public clone(name?: string, withPermissions?: boolean, withTopic?: boolean, reason?: string): Promise<GuildChannel>;
616
+ public createInvite(options?: InviteOptions, reason?: string): Promise<Invite>;
617
+ public delete(reason?: string): Promise<GuildChannel>;
618
+ public edit(data: ChannelData, reason?: string): Promise<GuildChannel>;
619
+ public equals(channel: GuildChannel): boolean;
620
+ public fetchInvites(): Promise<Collection<string, Invite>>;
621
+ public lockPermissions(): Promise<GuildChannel>;
622
+ public memberPermissions(member: GuildMemberResolvable): Permissions | null;
623
+ public overwritePermissions(userOrRole: RoleResolvable | UserResolvable, options: PermissionOverwriteOptions, reason?: string): Promise<void>;
624
+ public permissionsFor(memberOrRole: GuildMemberResolvable | RoleResolvable): Permissions | null;
625
+ public replacePermissionOverwrites(options?: { overwrites?: (PermissionOverwrites | ChannelCreationOverwrites)[] | Collection<Snowflake, ChannelCreationOverwrites>, reason?: string }): Promise<GuildChannel>;
626
+ public rolePermissions(role: RoleResolvable): Permissions;
627
+ public setName(name: string, reason?: string): Promise<GuildChannel>;
628
+ public setParent(parent: ChannelResolvable, reason?: string): Promise<GuildChannel>;
629
+ public setPosition(position: number, relative?: boolean): Promise<GuildChannel>;
630
+ public setTopic(topic: string, reason?: string): Promise<GuildChannel>;
631
+ public toString(): string;
632
+ }
633
+
634
+ export class GuildMember extends PartialTextBasedChannel() {
635
+ constructor(guild: Guild, data: object);
636
+ public readonly bannable: boolean;
637
+ public readonly client: Client;
638
+ public readonly colorRole: Role;
639
+ public readonly deaf: boolean;
640
+ public readonly displayColor: number;
641
+ public readonly displayHexColor: string;
642
+ public readonly displayName: string;
643
+ public guild: Guild;
644
+ public readonly highestRole: Role;
645
+ public readonly hoistRole: Role;
646
+ public readonly id: Snowflake;
647
+ public readonly joinedAt: Date;
648
+ public joinedTimestamp: number;
649
+ public readonly kickable: boolean;
650
+ public lastMessageID: string;
651
+ public readonly mute: boolean;
652
+ public nickname: string;
653
+ public readonly manageable: boolean;
654
+ public readonly permissions: Permissions;
655
+ public readonly presence: Presence;
656
+ public readonly roles: Collection<Snowflake, Role>;
657
+ public selfDeaf: boolean;
658
+ public selfMute: boolean;
659
+ public serverDeaf: boolean;
660
+ public serverMute: boolean;
661
+ public speaking: boolean;
662
+ public user: User;
663
+ public readonly voiceChannel: VoiceChannel;
664
+ public voiceChannelID: string;
665
+ public voiceSessionID: string;
666
+ public addRole(role: Role | Snowflake, reason?: string): Promise<GuildMember>;
667
+ public addRoles(roles: Collection<Snowflake, Role> | Role[] | Snowflake[], reason?: string): Promise<GuildMember>;
668
+ public ban(options?: BanOptions | number | string): Promise<GuildMember>;
669
+ public createDM(): Promise<DMChannel>;
670
+ public deleteDM(): Promise<DMChannel>;
671
+ public edit(data: GuildMemberEditData, reason?: string): Promise<GuildMember>;
672
+ public hasPermission(permission: PermissionResolvable, explicit?: boolean, checkAdmin?: boolean, checkOwner?: boolean): boolean;
673
+ public hasPermissions(permission: PermissionResolvable, explicit?: boolean): boolean;
674
+ public kick(reason?: string): Promise<GuildMember>;
675
+ public missingPermissions(permissions: PermissionResolvable, explicit?: boolean): PermissionResolvable;
676
+ public permissionsIn(channel: ChannelResolvable): Permissions;
677
+ public removeRole(role: Role | Snowflake, reason?: string): Promise<GuildMember>;
678
+ public removeRoles(roles: Collection<Snowflake, Role> | Role[] | Snowflake[], reason?: string): Promise<GuildMember>;
679
+ public setDeaf(deaf: boolean, reason?: string): Promise<GuildMember>;
680
+ public setMute(mute: boolean, reason?: string): Promise<GuildMember>;
681
+ public setNickname(nickname: string, reason?: string): Promise<GuildMember>;
682
+ public setRoles(roles: Collection<Snowflake, Role> | Role[] | Snowflake[], reason?: string): Promise<GuildMember>;
683
+ public setVoiceChannel(voiceChannel: ChannelResolvable | null): Promise<GuildMember>;
684
+ public toString(): string;
685
+ }
686
+
687
+ export class Invite {
688
+ constructor(client: Client, data: object);
689
+ public channel: GuildChannel | PartialGuildChannel;
690
+ public readonly client: Client;
691
+ public code: string;
692
+ public readonly createdAt: Date;
693
+ public createdTimestamp: number;
694
+ public readonly expiresAt: Date;
695
+ public readonly expiresTimestamp: number;
696
+ public guild: Guild | PartialGuild;
697
+ public inviter: User;
698
+ public maxAge: number;
699
+ public maxUses: number;
700
+ public memberCount: number;
701
+ public presenceCount: number;
702
+ public temporary: boolean;
703
+ public textChannelCount: number;
704
+ public readonly url: string;
705
+ public uses: number;
706
+ public voiceChannelCount: number;
707
+ public delete(reason?: string): Promise<Invite>;
708
+ public toString(): string;
709
+ }
710
+
711
+ export class Message {
712
+ constructor(channel: TextChannel | DMChannel | GroupDMChannel, data: object, client: Client);
713
+ private _edits: Message[];
714
+ private patch(data: object): void;
715
+
716
+ public attachments: Collection<Snowflake, MessageAttachment>;
717
+ public author: User;
718
+ public channel: TextChannel | DMChannel | GroupDMChannel;
719
+ public readonly cleanContent: string;
720
+ public readonly client: Client;
721
+ public content: string;
722
+ public readonly createdAt: Date;
723
+ public createdTimestamp: number;
724
+ public readonly deletable: boolean;
725
+ public readonly editable: boolean;
726
+ public readonly editedAt: Date;
727
+ public editedTimestamp: number;
728
+ public readonly edits: Message[];
729
+ public embeds: MessageEmbed[];
730
+ public readonly guild: Guild;
731
+ public hit: boolean;
732
+ public id: Snowflake;
733
+ public member: GuildMember;
734
+ public mentions: MessageMentions;
735
+ public nonce: string;
736
+ public readonly pinnable: boolean;
737
+ public pinned: boolean;
738
+ public reactions: Collection<Snowflake, MessageReaction>;
739
+ public system: boolean;
740
+ public tts: boolean;
741
+ public type: string;
742
+ public readonly url: string;
743
+ public webhookID: Snowflake;
744
+ public acknowledge(): Promise<Message>;
745
+ public awaitReactions(filter: CollectorFilter, options?: AwaitReactionsOptions): Promise<Collection<Snowflake, MessageReaction>>;
746
+ public clearReactions(): Promise<Message>;
747
+ public createReactionCollector(filter: CollectorFilter, options?: ReactionCollectorOptions): ReactionCollector;
748
+ public delete(timeout?: number): Promise<Message>;
749
+ public edit(content: StringResolvable, options?: MessageEditOptions | RichEmbed): Promise<Message>;
750
+ public editCode(lang: string, content: StringResolvable): Promise<Message>;
751
+ public equals(message: Message, rawData: object): boolean;
752
+ public fetchWebhook(): Promise<Webhook>;
753
+ public isMemberMentioned(member: GuildMember | User): boolean;
754
+ public isMentioned(data: GuildChannel | User | Role | Snowflake): boolean;
755
+ public pin(): Promise<Message>;
756
+ public react(emoji: string | Emoji | ReactionEmoji): Promise<MessageReaction>;
757
+ public reply(content?: StringResolvable, options?: MessageOptions): Promise<Message | Message[]>;
758
+ public reply(options?: MessageOptions): Promise<Message | Message[]>;
759
+ public toString(): string;
760
+ public unpin(): Promise<Message>;
761
+ }
762
+
763
+ export class MessageAttachment {
764
+ constructor(message: Message, data: object);
765
+ public readonly client: Client;
766
+ public filename: string;
767
+ public filesize: number;
768
+ public height: number;
769
+ public id: Snowflake;
770
+ public message: Message;
771
+ public proxyURL: string;
772
+ public url: string;
773
+ public width: number;
774
+ }
775
+
776
+ export class MessageCollector extends Collector<Snowflake, Message> {
777
+ constructor(channel: TextChannel | DMChannel | GroupDMChannel, filter: CollectorFilter, options?: MessageCollectorOptions);
778
+ public channel: Channel;
779
+ public options: MessageCollectorOptions;
780
+ public received: number;
781
+
782
+ public cleanup(): void;
783
+ public handle(message: Message): CollectorHandler<Snowflake, Message>;
784
+ public postCheck(): string;
785
+ }
786
+
787
+ export class MessageEmbed {
788
+ constructor(message: Message, data: object);
789
+ public author: MessageEmbedAuthor;
790
+ public readonly client: Client;
791
+ public color: number;
792
+ public readonly createdAt: Date;
793
+ public timestamp: number;
794
+ public description: string;
795
+ public fields: MessageEmbedField[];
796
+ public footer: MessageEmbedFooter;
797
+ public readonly hexColor: string;
798
+ public image: MessageEmbedImage;
799
+ public message: Message;
800
+ public provider: MessageEmbedProvider;
801
+ public thumbnail: MessageEmbedThumbnail;
802
+ public title: string;
803
+ public type: string;
804
+ public url: string;
805
+ public video: MessageEmbedVideo;
806
+ }
807
+
808
+ export class MessageEmbedAuthor {
809
+ constructor(embed: MessageEmbed, data: object);
810
+ public embed: MessageEmbed;
811
+ public iconURL: string;
812
+ public name: string;
813
+ public url: string;
814
+ }
815
+
816
+ export class MessageEmbedField {
817
+ constructor(embed: MessageEmbed, data: object);
818
+ public embed: MessageEmbed;
819
+ public inline: boolean;
820
+ public name: string;
821
+ public value: string;
822
+ }
823
+
824
+ export class MessageEmbedFooter {
825
+ constructor(embed: MessageEmbed, data: object);
826
+ public embed: MessageEmbed;
827
+ public iconURL: string;
828
+ public proxyIconURL: string;
829
+ public text: string;
830
+ }
831
+
832
+ export class MessageEmbedImage {
833
+ constructor(embed: MessageEmbed, data: object);
834
+ public embed: MessageEmbed;
835
+ public height: number;
836
+ public proxyURL: string;
837
+ public url: string;
838
+ public width: number;
839
+ }
840
+
841
+ export class MessageEmbedProvider {
842
+ constructor(embed: MessageEmbed, data: object);
843
+ public embed: MessageEmbed;
844
+ public name: string;
845
+ public url: string;
846
+ }
847
+
848
+ export class MessageEmbedThumbnail {
849
+ constructor(embed: MessageEmbed, data: object);
850
+ public embed: MessageEmbed;
851
+ public height: number;
852
+ public proxyURL: string;
853
+ public url: string;
854
+ public width: number;
855
+ }
856
+
857
+ export class MessageEmbedVideo {
858
+ constructor(embed: MessageEmbed, data: object);
859
+ public embed: MessageEmbed;
860
+ public height: number;
861
+ public url: string;
862
+ public width: number;
863
+ }
864
+
865
+ export class MessageMentions {
866
+ private _channels: Collection<Snowflake, GuildChannel>;
867
+ private _client: Client;
868
+ private _content: Message;
869
+ private _guild: Guild;
870
+ private _members: Collection<Snowflake, GuildMember>;
871
+
872
+ public readonly channels: Collection<Snowflake, TextChannel>;
873
+ public everyone: boolean;
874
+ public readonly members: Collection<Snowflake, GuildMember>;
875
+ public roles: Collection<Snowflake, Role>;
876
+ public users: Collection<Snowflake, User>;
877
+
878
+ public static CHANNELS_PATTERN: RegExp;
879
+ public static EVERYONE_PATTERN: RegExp;
880
+ public static ROLES_PATTERN: RegExp;
881
+ public static USERS_PATTERN: RegExp;
882
+ }
883
+
884
+ export class MessageReaction {
885
+ constructor(message: Message, emoji: object, count: number, me: boolean);
886
+ public count: number;
887
+ public readonly emoji: Emoji | ReactionEmoji;
888
+ public me: boolean;
889
+ public message: Message;
890
+ public users: Collection<string, User>;
891
+ public fetchUsers(limit?: number, options?: { after?: number; before?: number }): Promise<Collection<Snowflake, User>>;
892
+ public remove(user?: UserResolvable): Promise<MessageReaction>;
893
+ }
894
+
895
+ export class NewsChannel extends TextChannel {
896
+ constructor(guild: Guild, data: object);
897
+ public rateLimitPerUser: 0;
898
+ }
899
+
900
+ export class OAuth2Application {
901
+ constructor(client: Client, data: object);
902
+ public bot: object;
903
+ public botPublic: boolean;
904
+ public botRequireCodeGrant: boolean;
905
+ public readonly client: Client;
906
+ public readonly createdAt: Date;
907
+ public readonly createdTimestamp: number;
908
+ public description: string;
909
+ public flags: number;
910
+ public icon: string;
911
+ public iconURL: string;
912
+ public id: Snowflake;
913
+ public name: string;
914
+ public owner: User;
915
+ public redirectURIs: string[];
916
+ public rpcApplicationState: boolean;
917
+ public rpcOrigins: string[];
918
+ public secret: string;
919
+ public reset(): OAuth2Application;
920
+ public toString(): string;
921
+ }
922
+
923
+ export class PartialGuild {
924
+ constructor(client: Client, data: object);
925
+ public readonly client: Client;
926
+ public icon: string;
927
+ public id: Snowflake;
928
+ public name: string;
929
+ public splash: string;
930
+ }
931
+
932
+ export class PartialGuildChannel {
933
+ constructor(client: Client, data: object);
934
+ public readonly client: Client;
935
+ public id: Snowflake;
936
+ public name: string;
937
+ public type: string;
938
+ }
939
+
940
+ export class PermissionOverwrites {
941
+ constructor(guildChannel: GuildChannel, data: object);
942
+ public allow: number;
943
+ public allowed: Permissions;
944
+ public channel: GuildChannel;
945
+ public denied: Permissions;
946
+ public deny: number;
947
+ public id: Snowflake;
948
+ public type: string;
949
+ public delete(reason?: string): Promise<PermissionOverwrites>;
950
+ }
951
+
952
+ export class Permissions {
953
+ constructor(permissions: PermissionResolvable);
954
+ constructor(member: GuildMember, permissions: PermissionResolvable);
955
+ private readonly raw: number;
956
+
957
+ public bitfield: number;
958
+ public member: GuildMember;
959
+ public add(...permissions: PermissionResolvable[]): this;
960
+ public freeze(): this;
961
+ public has(permission: PermissionResolvable, checkAdmin?: boolean): boolean;
962
+ public hasPermission(permission: PermissionResolvable, explicit?: boolean): boolean;
963
+ public hasPermissions(permissions: PermissionResolvable, explicit?: boolean): boolean;
964
+ public missing(permissions: PermissionResolvable, checkAdmin?: boolean): PermissionResolvable;
965
+ public missingPermissions(permissions: PermissionResolvable, checkAdmin?: boolean): PermissionResolvable;
966
+ public remove(...permissions: PermissionResolvable[]): this;
967
+ public serialize(checkAdmin?: boolean): PermissionObject;
968
+ public toArray(checkAdmin?: boolean): PermissionString[];
969
+ public valueOf(): number;
970
+
971
+ public static ALL: number;
972
+ public static DEFAULT: number;
973
+ public static FLAGS: PermissionFlags;
974
+ public static resolve(permission: PermissionResolvable): number;
975
+ }
976
+
977
+ export class Presence {
978
+ constructor(data: object, client: Client);
979
+ public readonly client: Client;
980
+ public game: Game;
981
+ public status: PresenceStatusData;
982
+ public clientStatus: ClientPresenceStatusData;
983
+ public equals(presence: Presence): boolean;
984
+ }
985
+
986
+ export class ReactionCollector extends Collector<Snowflake, MessageReaction> {
987
+ constructor(message: Message, filter: CollectorFilter, options?: ReactionCollectorOptions);
988
+ public message: Message;
989
+ public options: ReactionCollectorOptions;
990
+ public total: number;
991
+ public users: Collection<Snowflake, User>;
992
+
993
+ public cleanup(): void;
994
+ public handle(reaction: MessageReaction): CollectorHandler<Snowflake, MessageReaction>;
995
+ public postCheck(reaction: MessageReaction, user: User): string;
996
+ }
997
+
998
+ export class ReactionEmoji {
999
+ constructor(reaction: MessageReaction, name: string, id: string);
1000
+ public id: Snowflake;
1001
+ public readonly identifier: string;
1002
+ public name: string;
1003
+ public reaction: MessageReaction;
1004
+ public toString(): string;
1005
+ }
1006
+
1007
+ class RequestHandler {
1008
+ constructor(restManager: object);
1009
+ public readonly globalLimit: boolean;
1010
+ public queue: object[];
1011
+ public restManager: object;
1012
+ public handle(): void;
1013
+ public push(request: object): void;
1014
+ }
1015
+
1016
+ export class RichEmbed {
1017
+ constructor(data?: RichEmbedOptions | MessageEmbed);
1018
+ private _apiTransform(): object;
1019
+
1020
+ public author?: { name: string; url?: string; icon_url?: string; };
1021
+ public color?: number;
1022
+ public description?: string;
1023
+ public fields?: { name: string; value: string; inline?: boolean; }[];
1024
+ public file?: Attachment | string | FileOptions;
1025
+ public files?: Array<Attachment | string | FileOptions>;
1026
+ public footer?: { text?: string; icon_url?: string; };
1027
+ public image?: { url: string; proxy_url?: string; height?: number; width?: number; };
1028
+ public readonly length: number;
1029
+ public thumbnail?: { url: string; height?: number; width?: number; };
1030
+ public timestamp?: Date;
1031
+ public title?: string;
1032
+ public url?: string;
1033
+ public addBlankField(inline?: boolean): this;
1034
+ public addField(name: StringResolvable, value: StringResolvable, inline?: boolean): this;
1035
+ public attachFile(file: Attachment | FileOptions | string): this;
1036
+ public attachFiles(file: Array<Attachment | FileOptions | string>): this;
1037
+ public setAuthor(name: StringResolvable, icon?: string, url?: string): this;
1038
+ public setColor(color: ColorResolvable): this;
1039
+ public setDescription(description: StringResolvable): this;
1040
+ public setFooter(text: StringResolvable, icon?: string): this;
1041
+ public setImage(url: string): this;
1042
+ public setThumbnail(url: string): this;
1043
+ public setTimestamp(timestamp?: Date | number): this;
1044
+ public setTitle(title: StringResolvable): this;
1045
+ public setURL(url: string): this;
1046
+ }
1047
+
1048
+ export class RichPresenceAssets {
1049
+ constructor(game: Game, assets: object);
1050
+ public largeImage: Snowflake;
1051
+ public largeText: string;
1052
+ public smallImage: Snowflake;
1053
+ public smallText: string;
1054
+ public readonly smallImageURL: string;
1055
+ public readonly largeImageURL: string;
1056
+ }
1057
+
1058
+ export class Role {
1059
+ constructor(guild: Guild, data: object);
1060
+ public readonly calculatedPosition: number;
1061
+ public readonly client: Client;
1062
+ public color: number;
1063
+ public readonly createdAt: Date;
1064
+ public readonly createdTimestamp: number;
1065
+ public readonly editable: boolean;
1066
+ public guild: Guild;
1067
+ public readonly hexColor: string;
1068
+ public hoist: boolean;
1069
+ public id: Snowflake;
1070
+ public managed: boolean;
1071
+ public readonly members: Collection<Snowflake, GuildMember>;
1072
+ public mentionable: boolean;
1073
+ public name: string;
1074
+ public permissions: number;
1075
+ public position: number;
1076
+ public comparePositionTo(role: Role): number;
1077
+ public delete(reason?: string): Promise<Role>;
1078
+ public edit(data: RoleData, reason?: string): Promise<Role>;
1079
+ public equals(role: Role): boolean;
1080
+ public hasPermission(permission: PermissionResolvable, explicit?: boolean, checkAdmin?: boolean): boolean;
1081
+ public hasPermissions(permissions: PermissionResolvable, explicit?: boolean): boolean;
1082
+ public serialize(): PermissionObject;
1083
+ public setColor(color: string | number, reason?: string): Promise<Role>;
1084
+ public setHoist(hoist: boolean, reason?: string): Promise<Role>;
1085
+ public setMentionable(mentionable: boolean, reason?: string): Promise<Role>;
1086
+ public setName(name: string, reason?: string): Promise<Role>;
1087
+ public setPermissions(permissions: PermissionResolvable, reason?: string): Promise<Role>;
1088
+ public setPosition(position: number, relative?: boolean): Promise<Role>;
1089
+ public toString(): string;
1090
+
1091
+ public static comparePositions(role1: Role, role2: Role): number;
1092
+ }
1093
+
1094
+ class SecretKey {
1095
+ constructor(key: Uint8Array);
1096
+ public key: Uint8Array;
1097
+ }
1098
+
1099
+ class SequentialRequestHandler extends RequestHandler {
1100
+ constructor(restManager: object, endpoint: string);
1101
+ public busy: boolean;
1102
+ public endpoint: string;
1103
+ public readonly globalLimit: boolean;
1104
+ public queue: object[];
1105
+ public restManager: object;
1106
+ public timeDifference: number;
1107
+ public execute(item: object): Promise<object | Error>;
1108
+ public handle(): void;
1109
+ public push(request: object): void;
1110
+ }
1111
+
1112
+ export class Shard extends EventEmitter {
1113
+ constructor(manager: ShardingManager, id: number, args?: string[]);
1114
+ private _exitListener: Function;
1115
+ private _handleExit(respawn?: boolean): void;
1116
+ private _handleMessage(message: any): void;
1117
+
1118
+ public env: object;
1119
+ public id: string;
1120
+ public manager: ShardingManager;
1121
+ public process: ChildProcess;
1122
+ public readonly: boolean;
1123
+ public eval(script: string): Promise<any>;
1124
+ public fetchClientValue(prop: string): Promise<any>;
1125
+ public kill(): void;
1126
+ public respawn(delay?: number): Promise<ChildProcess>;
1127
+ public spawn(args?: string[], execArgv?: string[]): Promise<ChildProcess>;
1128
+ public send(message: any): Promise<Shard>;
1129
+
1130
+ public on(event: 'death', listener: () => void): this;
1131
+ public on(event: 'disconnect', listener: () => void): this;
1132
+ public on(event: 'message', listener: (message: any) => void): this;
1133
+ public on(event: 'ready', listener: () => void): this;
1134
+ public on(event: 'reconnecting', listener: () => void): this;
1135
+ public on(event: string, listener: Function): this;
1136
+
1137
+ public once(event: 'death', listener: () => void): this;
1138
+ public once(event: 'disconnect', listener: () => void): this;
1139
+ public once(event: 'message', listener: (message: any) => void): this;
1140
+ public once(event: 'ready', listener: () => void): this;
1141
+ public once(event: 'reconnecting', listener: () => void): this;
1142
+ public once(event: string, listener: Function): this;
1143
+ }
1144
+
1145
+ export class ShardClientUtil {
1146
+ constructor(client: Client);
1147
+ private _handleMessage(message: any): void;
1148
+ private _respond(type: string, message: any): void;
1149
+
1150
+ public readonly count: number;
1151
+ public readonly id: number;
1152
+ public broadcastEval(script: string): Promise<any[]>;
1153
+ public fetchClientValues(prop: string): Promise<any[]>;
1154
+ public send(message: any): Promise<void>;
1155
+
1156
+ public static singleton(client: Client): ShardClientUtil;
1157
+ }
1158
+
1159
+ export class ShardingManager extends EventEmitter {
1160
+ constructor(file: string, options?: {
1161
+ totalShards?: number | 'auto';
1162
+ respawn?: boolean;
1163
+ shardArgs?: string[];
1164
+ token?: string;
1165
+ });
1166
+ private _spawn(amount: number, delay: number): Promise<Collection<number, Shard>>;
1167
+
1168
+ public execArgv: string[];
1169
+ public file: string;
1170
+ public respawn: boolean;
1171
+ public shardArgs: string[];
1172
+ public shards: Collection<number, Shard>;
1173
+ public token: string;
1174
+ public totalShards: number | string;
1175
+ public broadcast(message: any): Promise<Shard[]>;
1176
+ public broadcastEval(script: string): Promise<any[]>;
1177
+ public createShard(id: number): Promise<Shard>;
1178
+ public fetchClientValues(prop: string): Promise<any[]>;
1179
+ public respawnAll(shardDelay?: number, respawnDelay?: number, waitForReady?: true, currentShardIndex?: number): Promise<Collection<number, Shard>>;
1180
+ public spawn(amount?: number, delay?: number): Promise<Collection<number, Shard>>;
1181
+
1182
+ public on(event: 'launch', listener: (shard: Shard) => void): this;
1183
+ public on(event: 'message', listener: (shard: Shard, message: any) => void): this;
1184
+ public on(event: string, listener: Function): this;
1185
+
1186
+ public once(event: 'launch', listener: (shard: Shard) => void): this;
1187
+ public once(event: 'message', listener: (shard: Shard, message: any) => void): this;
1188
+ public once(event: string, listener: Function): this;
1189
+ }
1190
+
1191
+ export class SnowflakeUtil {
1192
+ public static deconstruct(snowflake: Snowflake): DeconstructedSnowflake;
1193
+ public static generate(timestamp?: number | Date): Snowflake;
1194
+ }
1195
+
1196
+ export class StoreChannel extends GuildChannel {
1197
+ constructor(guild: Guild, data: object);
1198
+ public nsfw: boolean;
1199
+ }
1200
+
1201
+ export class StreamDispatcher extends VolumeInterface {
1202
+ constructor(player: AudioPlayer, stream: NodeJS.ReadableStream, streamOptions: StreamOptions);
1203
+ public destroyed: boolean;
1204
+ public readonly passes: number;
1205
+ public paused: boolean;
1206
+ public player: AudioPlayer;
1207
+ public stream: ReadableStream | VoiceBroadcast;
1208
+ public readonly time: number;
1209
+ public readonly totalStreamTime: number;
1210
+ public end(reason?: string): void;
1211
+ public pause(): void;
1212
+ public resume(): void;
1213
+ public setBitrate(bitrate: number | 'auto'): void;
1214
+ }
1215
+
1216
+ export class TextChannel extends TextBasedChannel(GuildChannel) {
1217
+ constructor(guild: Guild, data: object);
1218
+ public lastMessageID: string;
1219
+ public readonly members: Collection<Snowflake, GuildMember>;
1220
+ public messages: Collection<Snowflake, Message>;
1221
+ public nsfw: boolean;
1222
+ public topic: string;
1223
+ public setRateLimitPerUser(rateLimitPerUser: number, reason?: string): Promise<TextChannel>;
1224
+ public createWebhook(name: string, avatar: BufferResolvable, reason?: string): Promise<Webhook>;
1225
+ public fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>;
1226
+ public setNSFW(nsfw: boolean, reason: string): Promise<this>;
1227
+ }
1228
+
1229
+ export class User extends PartialTextBasedChannel() {
1230
+ constructor(client: Client, data: object);
1231
+ public avatar: string;
1232
+ public readonly avatarURL: string;
1233
+ public bot: boolean;
1234
+ public readonly client: Client;
1235
+ public readonly createdAt: Date;
1236
+ public readonly createdTimestamp: number;
1237
+ public readonly defaultAvatarURL: string;
1238
+ public discriminator: string;
1239
+ public readonly displayAvatarURL: string;
1240
+ public readonly dmChannel: DMChannel;
1241
+ public id: Snowflake;
1242
+ public lastMessageID: string;
1243
+ public readonly note: string;
1244
+ public readonly presence: Presence;
1245
+ public readonly tag: string;
1246
+ public username: string;
1247
+ public addFriend(): Promise<User>;
1248
+ public block(): Promise<User>;
1249
+ public createDM(): Promise<DMChannel>;
1250
+ public deleteDM(): Promise<DMChannel>;
1251
+ public equals(user: User): boolean;
1252
+ public fetchProfile(): Promise<UserProfile>;
1253
+ public removeFriend(): Promise<User>;
1254
+ public setNote(note: string): Promise<User>;
1255
+ public toString(): string;
1256
+ public typingDurationIn(channel: ChannelResolvable): number;
1257
+ public typingIn(channel: ChannelResolvable): boolean;
1258
+ public typingSinceIn(channel: ChannelResolvable): Date;
1259
+ public unblock(): Promise<User>;
1260
+ }
1261
+
1262
+ export class UserConnection {
1263
+ constructor(user: User, data: object);
1264
+ public id: string;
1265
+ public integrations: object[];
1266
+ public name: string;
1267
+ public revoked: boolean;
1268
+ public type: string;
1269
+ public user: User;
1270
+ }
1271
+
1272
+ export class UserProfile {
1273
+ constructor(user: User, data: object);
1274
+ public readonly client: Client;
1275
+ public connections: Collection<string, UserConnection>;
1276
+ public mutualGuilds: Collection<Snowflake, Guild>;
1277
+ public premium: boolean;
1278
+ public premiumSince: Date;
1279
+ public user: User;
1280
+ }
1281
+
1282
+ export class Util {
1283
+ public static arraysEqual(a: any[], b: any[]): boolean;
1284
+ public static cloneObject(obj: object): object;
1285
+ public static convertToBuffer(ab: ArrayBuffer | string): Buffer;
1286
+ public static delayFor(ms: number): Promise<void>;
1287
+ public static escapeMarkdown(text: string, onlyCodeBlock?: boolean, onlyInlineCode?: boolean): string;
1288
+ public static fetchRecommendedShards(token: string, guildsPerShard?: number): Promise<number>;
1289
+ public static makeError(obj: { name: string, message: string, stack: string }): Error;
1290
+ public static makePlainError(err: Error): object;
1291
+ public static mergeDefault(def: object, given: object): object;
1292
+ public static moveElementInArray(array: any[], element: any, newIndex: number, offset?: boolean): number;
1293
+ public static parseEmoji(text: string): { animated: boolean; name: string; id: string; };
1294
+ public static splitMessage(text: string, options?: SplitOptions): string | string[];
1295
+ public static str2ab(str: string): ArrayBuffer;
1296
+ }
1297
+
1298
+ export class VoiceBroadcast extends EventEmitter {
1299
+ constructor(client: Client);
1300
+ public readonly client: Client;
1301
+ public currentTranscoder: object;
1302
+ public readonly dispatchers: StreamDispatcher[];
1303
+ public prism: object;
1304
+ public destroy(): void;
1305
+ public end(): void;
1306
+ public pause(): void;
1307
+ public playArbitraryInput(input: string, options?: StreamOptions): VoiceBroadcast;
1308
+ public playConvertedStream(stream: ReadableStream, options?: StreamOptions): VoiceBroadcast;
1309
+ public playFile(file: string, options?: StreamOptions): StreamDispatcher;
1310
+ public playOpusStream(stream: ReadableStream, options?: StreamOptions): StreamDispatcher;
1311
+ public playStream(stream: ReadableStream, options?: StreamOptions): VoiceBroadcast;
1312
+ public resume(): void;
1313
+
1314
+ public on(event: string, listener: Function): this;
1315
+ public on(event: 'end', listener: () => void): this;
1316
+ public on(event: 'error', listener: (error: Error) => void): this;
1317
+ public on(event: 'subscribe', listener: (dispatcher: StreamDispatcher) => void): this;
1318
+ public on(event: 'unsubscribe', listener: (dispatcher: StreamDispatcher) => void): this;
1319
+ public on(event: 'warn', listener: (warning: string | Error) => void): this;
1320
+ public on(event: string, listener: Function): this;
1321
+
1322
+ public once(event: 'end', listener: () => void): this;
1323
+ public once(event: 'error', listener: (error: Error) => void): this;
1324
+ public once(event: 'subscribe', listener: (dispatcher: StreamDispatcher) => void): this;
1325
+ public once(event: 'unsubscribe', listener: (dispatcher: StreamDispatcher) => void): this;
1326
+ public once(event: 'warn', listener: (warning: string | Error) => void): this;
1327
+ public once(event: string, listener: Function): this;
1328
+ }
1329
+
1330
+ export class VoiceChannel extends GuildChannel {
1331
+ constructor(guild: Guild, data: object);
1332
+ public bitrate: number;
1333
+ public readonly connection: VoiceConnection;
1334
+ public readonly full: boolean;
1335
+ public readonly joinable: boolean;
1336
+ public members: Collection<Snowflake, GuildMember>;
1337
+ public readonly speakable: boolean;
1338
+ public userLimit: number;
1339
+ public join(): Promise<VoiceConnection>;
1340
+ public leave(): void;
1341
+ public setBitrate(bitrate: number, reason?: string): Promise<VoiceChannel>;
1342
+ public setUserLimit(userLimit: number, reason?: string): Promise<VoiceChannel>;
1343
+ }
1344
+
1345
+ export class VoiceConnection extends EventEmitter {
1346
+ constructor(voiceManager: ClientVoiceManager, channel: VoiceChannel);
1347
+ private authentication: object;
1348
+ private sockets: object;
1349
+ private ssrcMap: Map<number, boolean>;
1350
+ private authenticate(): void;
1351
+ private authenticateFailed(reason: string): void;
1352
+ private checkAuthenticated(): void;
1353
+ private cleanup(): void;
1354
+ private connect(): void;
1355
+ private onReady(data: object): void;
1356
+ private onSessionDescription(mode: string, secret: string): void;
1357
+ private onSpeaking(data: object): void;
1358
+ private reconnect(token: string, endpoint: string): void;
1359
+ private setSpeaking(value: boolean): void;
1360
+ private updateChannel(channel: VoiceChannel): void;
1361
+
1362
+ public channel: VoiceChannel;
1363
+ public readonly client: Client;
1364
+ public readonly dispatcher: StreamDispatcher;
1365
+ public player: AudioPlayer;
1366
+ public prism: object;
1367
+ public receivers: VoiceReceiver[];
1368
+ public speaking: boolean;
1369
+ public status: number;
1370
+ public voiceManager: ClientVoiceManager;
1371
+ public createReceiver(): VoiceReceiver;
1372
+ public disconnect(): void;
1373
+ public playArbitraryInput(input: string, options?: StreamOptions): StreamDispatcher;
1374
+ public playBroadcast(broadcast: VoiceBroadcast, options?: StreamOptions): StreamDispatcher;
1375
+ public playConvertedStream(stream: ReadableStream, options?: StreamOptions): StreamDispatcher;
1376
+ public playFile(file: string, options?: StreamOptions): StreamDispatcher;
1377
+ public playOpusStream(steam: ReadableStream, options?: StreamOptions): StreamDispatcher;
1378
+ public playStream(stream: ReadableStream, options?: StreamOptions): StreamDispatcher;
1379
+ public sendVoiceStateUpdate(options: object): void;
1380
+ public setSessionID(sessionID: string): void;
1381
+ public setTokenAndEndpoint(token: string, endpoint: string): void;
1382
+
1383
+ public on(event: 'authenticated', listener: () => void): this;
1384
+ public on(event: 'debug', listener: (message: string) => void): this;
1385
+ public on(event: 'disconnect', listener: (error: Error) => void): this;
1386
+ public on(event: 'error', listener: (error: Error) => void): this;
1387
+ public on(event: 'failed', listener: (error: Error) => void): this;
1388
+ public on(event: 'newSession', listener: () => void): this;
1389
+ public on(event: 'ready', listener: () => void): this;
1390
+ public on(event: 'reconnecting', listener: () => void): this;
1391
+ public on(event: 'speaking', listener: (user: User, speaking: boolean) => void): this;
1392
+ public on(event: 'warn', listener: (warning: string | Error) => void): this;
1393
+ public on(event: string, listener: Function): this;
1394
+
1395
+ public once(event: 'authenticated', listener: () => void): this;
1396
+ public once(event: 'debug', listener: (message: string) => void): this;
1397
+ public once(event: 'disconnect', listener: (error: Error) => void): this;
1398
+ public once(event: 'error', listener: (error: Error) => void): this;
1399
+ public once(event: 'failed', listener: (error: Error) => void): this;
1400
+ public once(event: 'newSession', listener: () => void): this;
1401
+ public once(event: 'ready', listener: () => void): this;
1402
+ public once(event: 'reconnecting', listener: () => void): this;
1403
+ public once(event: 'speaking', listener: (user: User, speaking: boolean) => void): this;
1404
+ public once(event: 'warn', listener: (warning: string | Error) => void): this;
1405
+ public once(event: string, listener: Function): this;
1406
+ }
1407
+
1408
+ class VoiceConnectionUDPClient extends EventEmitter {
1409
+ constructor(voiceConnection: VoiceConnection);
1410
+ public discordAddress: string;
1411
+ public readonly discordPort: number;
1412
+ public localAddress: string;
1413
+ public localPort: string;
1414
+ public socket: any;
1415
+ public voiceConnection: VoiceConnection;
1416
+ public findEndpointAddress(): Promise<string>;
1417
+ public send(packet: object): Promise<object>;
1418
+ }
1419
+
1420
+ export class VoiceReceiver extends EventEmitter {
1421
+ constructor(connection: VoiceConnection);
1422
+ private stoppedSpeaking(user: User): void;
1423
+
1424
+ public destroyed: boolean;
1425
+ public voiceConnection: VoiceConnection;
1426
+ public createOpusStream(user: UserResolvable): ReadableStream;
1427
+ public createPCMStream(user: UserResolvable): ReadableStream;
1428
+ public destroy(): void;
1429
+ public recreate(): void;
1430
+
1431
+ public on(event: 'opus', listener: (user: User, buffer: Buffer) => void): this;
1432
+ public on(event: 'pcm', listener: (user: User, buffer: Buffer) => void): this;
1433
+ public on(event: 'warn', listener: (reason: string, message: string) => void): this;
1434
+ public on(event: string, listener: Function): this;
1435
+
1436
+ public once(event: 'opus', listener: (user: User, buffer: Buffer) => void): this;
1437
+ public once(event: 'pcm', listener: (user: User, buffer: Buffer) => void): this;
1438
+ public once(event: 'warn', listener: (reason: string, message: string) => void): this;
1439
+ public once(event: string, listener: Function): this;
1440
+ }
1441
+
1442
+ export class VoiceRegion {
1443
+ constructor(data: object);
1444
+ public custom: boolean;
1445
+ public deprecated: boolean;
1446
+ public id: string;
1447
+ public name: string;
1448
+ public optimal: boolean;
1449
+ public sampleHostname: string;
1450
+ public vip: boolean;
1451
+ }
1452
+
1453
+ class VoiceWebsocket extends EventEmitter {
1454
+ constructor(voiceConnection: VoiceConnection);
1455
+ public attempts: number;
1456
+ public readonly client: Client;
1457
+ public voiceConnection: VoiceConnection;
1458
+ public ws: any;
1459
+ public clearHeartbeat(): void;
1460
+ public connect(): void;
1461
+ public onClose(): void;
1462
+ public onError(error: Error): void;
1463
+ public onMessage(event: any): void;
1464
+ public onOpen(): void;
1465
+ public onPacket(packet: object): void;
1466
+ public reset(): void;
1467
+ public send(data: string): Promise<string>;
1468
+ public sendHeartbeat(): void;
1469
+ public sendPacket(packet: object): Promise<string>;
1470
+ public setHeartbeat(interval: number): void;
1471
+
1472
+ public on(event: 'ready', listener: (packet: object) => void): this;
1473
+ public on(event: 'sessionDescription', listener: (encryptionMode: string, secretKey: SecretKey) => void): this;
1474
+ public on(event: 'speaking', listener: (data: object) => void): this;
1475
+ public on(event: 'unknownPacket', listener: (packet: object) => void): this;
1476
+ public on(event: 'warn', listener: (warn: string) => void): this;
1477
+ public on(event: string, listener: Function): this;
1478
+
1479
+ public once(event: 'ready', listener: (packet: object) => void): this;
1480
+ public once(event: 'sessionDescription', listener: (encryptionMode: string, secretKey: SecretKey) => void): this;
1481
+ public once(event: 'speaking', listener: (data: object) => void): this;
1482
+ public once(event: 'unknownPacket', listener: (packet: object) => void): this;
1483
+ public once(event: 'warn', listener: (warn: string) => void): this;
1484
+ public once(event: string, listener: Function): this;
1485
+ }
1486
+
1487
+ export class VolumeInterface extends EventEmitter {
1488
+ constructor(object?: { volume: number })
1489
+ public readonly volume: number;
1490
+ public readonly volumeDecibels: number;
1491
+ public readonly volumeLogarithmic: number;
1492
+ public setVolume(volume: number): void;
1493
+ public setVolumeDecibels(db: number): void;
1494
+ public setVolumeLogarithmic(value: number): void;
1495
+
1496
+ public on(event: 'debug', listener: (information: string) => void): this;
1497
+ public on(event: 'end', listener: (reason: string) => void): this;
1498
+ public on(event: 'error', listener: (err: Error) => void): this;
1499
+ public on(event: 'speaking', listener: (value: boolean) => void): this;
1500
+ public on(event: 'start', listener: () => void): this;
1501
+ public on(event: 'volumeChange', listener: (oldVolume: number, newVolume: number) => void): this;
1502
+ public on(event: string, listener: Function): this;
1503
+
1504
+ public once(event: 'debug', listener: (information: string) => void): this;
1505
+ public once(event: 'end', listener: (reason: string) => void): this;
1506
+ public once(event: 'error', listener: (err: Error) => void): this;
1507
+ public once(event: 'speaking', listener: (value: boolean) => void): this;
1508
+ public once(event: 'start', listener: () => void): this;
1509
+ public once(event: 'volumeChange', listener: (oldVolume: number, newVolume: number) => void): this;
1510
+ public once(event: string, listener: Function): this;
1511
+ }
1512
+
1513
+ export class Webhook {
1514
+ constructor(client: Client, dataOrID: object | string, token: string);
1515
+ public avatar: string;
1516
+ public channelID: string;
1517
+ public readonly client: Client;
1518
+ public guildID: string;
1519
+ public id: Snowflake;
1520
+ public name: string;
1521
+ public owner: User | object;
1522
+ public token: string;
1523
+ public delete(reason?: string): Promise<void>;
1524
+ public edit(name: string, avatar: BufferResolvable): Promise<Webhook>;
1525
+ public send(content?: StringResolvable, options?: WebhookMessageOptions | RichEmbed | Attachment): Promise<Message | Message[]>;
1526
+ public send(options?: WebhookMessageOptions | RichEmbed | Attachment): Promise<Message | Message[]>;
1527
+ public sendCode(lang: string, content: StringResolvable, options?: WebhookMessageOptions): Promise<Message | Message[]>;
1528
+ public sendFile(attachment: BufferResolvable, name?: string, content?: StringResolvable, options?: WebhookMessageOptions): Promise<Message>;
1529
+ public sendMessage(content?: StringResolvable, options?: WebhookMessageOptions): Promise<Message | Message[]>;
1530
+ public sendMessage(options?: WebhookMessageOptions): Promise<Message | Message[]>;
1531
+ public sendSlackMessage(body: object): Promise<void>;
1532
+ }
1533
+
1534
+ export class WebhookClient extends Webhook {
1535
+ constructor(id: string, token: string, options?: ClientOptions);
1536
+ private _intervals: Set<NodeJS.Timer>;
1537
+ private _timeouts: Set<NodeJS.Timer>;
1538
+ private resolver: ClientDataResolver;
1539
+ private rest: object;
1540
+
1541
+ public options: ClientOptions;
1542
+ public clearInterval(interval: NodeJS.Timer): void;
1543
+ public clearTimeout(timeout: NodeJS.Timer): void;
1544
+ public destroy(): void;
1545
+ public setInterval(fn: Function, delay: number, ...args: any[]): NodeJS.Timer;
1546
+ public setTimeout(fn: Function, delay: number, ...args: any[]): NodeJS.Timer;
1547
+ }
1548
+
1549
+ //#endregion
1550
+
1551
+ //#region Mixins
1552
+
1553
+ // Model the TextBasedChannel mixin system, allowing application of these fields
1554
+ // to the classes that use these methods without having to manually add them
1555
+ // to each of those classes
1556
+
1557
+ type Constructable<T> = new (...args: any[]) => T;
1558
+ const PartialTextBasedChannel: <T>(Base?: Constructable<T>) => Constructable<T & PartialTextBasedChannelFields>;
1559
+ const TextBasedChannel: <T>(Base?: Constructable<T>) => Constructable<T & TextBasedChannelFields>;
1560
+
1561
+ type PartialTextBasedChannelFields = {
1562
+ lastMessage: Message;
1563
+ acknowledge(): Promise<DMChannel | GroupDMChannel | TextChannel>;
1564
+ send(content?: StringResolvable, options?: MessageOptions | RichEmbed | Attachment): Promise<Message | Message[]>;
1565
+ send(options?: MessageOptions | RichEmbed | Attachment): Promise<Message | Message[]>;
1566
+ sendCode(lang: string, content: StringResolvable, options?: MessageOptions): Promise<Message | Message[]>;
1567
+ sendEmbed(embed: RichEmbed | RichEmbedOptions, content?: string, options?: MessageOptions): Promise<Message>;
1568
+ sendEmbed(embed: RichEmbed | RichEmbedOptions, options?: MessageOptions): Promise<Message>;
1569
+ sendFile(attachment: BufferResolvable, name?: string, content?: StringResolvable, options?: MessageOptions): Promise<Message>;
1570
+ sendMessage(content?: string, options?: MessageOptions): Promise<Message | Message[]>;
1571
+ sendMessage(options?: MessageOptions): Promise<Message | Message[]>;
1572
+ };
1573
+
1574
+ type TextBasedChannelFields = {
1575
+ lastPinTimestamp: number;
1576
+ readonly lastPinAt: Date;
1577
+ typing: boolean;
1578
+ typingCount: number;
1579
+ awaitMessages(filter: CollectorFilter, options?: AwaitMessagesOptions): Promise<Collection<string, Message>>;
1580
+ bulkDelete(messages: Collection<string, Message> | Message[] | Snowflake[] | number, filterOld?: boolean): Promise<Collection<string, Message>>;
1581
+ createCollector(filter: CollectorFilter, options?: MessageCollectorOptions): MessageCollector;
1582
+ createMessageCollector(filter: CollectorFilter, options?: MessageCollectorOptions): MessageCollector;
1583
+ fetchMessage(messageID: string): Promise<Message>;
1584
+ fetchMessages(options?: ChannelLogsQueryOptions): Promise<Collection<string, Message>>;
1585
+ fetchPinnedMessages(): Promise<Collection<string, Message>>;
1586
+ search(options?: MessageSearchOptions): Promise<MessageSearchResult>;
1587
+ startTyping(count?: number): void;
1588
+ stopTyping(force?: boolean): void;
1589
+ } & PartialTextBasedChannelFields;
1590
+
1591
+ //#endregion
1592
+
1593
+ //#region Typedefs
1594
+
1595
+ type ActivityType = 'PLAYING'
1596
+ | 'STREAMING'
1597
+ | 'LISTENING'
1598
+ | 'WATCHING';
1599
+
1600
+ type AddGuildMemberOptions = {
1601
+ accessToken: String;
1602
+ nick?: string;
1603
+ roles?: Collection<string, Role> | Role[] | string[];
1604
+ mute?: boolean;
1605
+ deaf?: boolean;
1606
+ };
1607
+
1608
+ type AuditLogChange = {
1609
+ key: string;
1610
+ old?: any;
1611
+ new?: any;
1612
+ };
1613
+
1614
+ type AwaitMessagesOptions = MessageCollectorOptions & { errors?: string[] };
1615
+
1616
+ type AwaitReactionsOptions = ReactionCollectorOptions & { errors?: string[] };
1617
+
1618
+ type BanInfo = {
1619
+ user: User;
1620
+ reason: string | null;
1621
+ };
1622
+
1623
+ type BanOptions = {
1624
+ days?: number;
1625
+ reason?: string;
1626
+ };
1627
+
1628
+ type Base64Resolvable = Buffer | Base64String;
1629
+
1630
+ type Base64String = string;
1631
+
1632
+ type BufferResolvable = Buffer | string;
1633
+
1634
+ type ChannelCreationOverwrites = {
1635
+ allow?: PermissionResolvable;
1636
+ deny?: PermissionResolvable;
1637
+ allowed?: PermissionResolvable;
1638
+ denied?: PermissionResolvable;
1639
+ id: RoleResolvable | UserResolvable;
1640
+ };
1641
+
1642
+ type ChannelData = {
1643
+ type?: 'category' | 'text' | 'voice' | 'news' | 'store';
1644
+ name?: string;
1645
+ position?: number;
1646
+ topic?: string;
1647
+ nsfw?: boolean;
1648
+ bitrate?: number;
1649
+ userLimit?: number;
1650
+ parent?: ChannelResolvable;
1651
+ permissionOverwrites?: PermissionOverwrites[] | ChannelCreationOverwrites[];
1652
+ rateLimitPerUser?: number;
1653
+ };
1654
+
1655
+ type ChannelLogsQueryOptions = {
1656
+ limit?: number
1657
+ before?: Snowflake
1658
+ after?: Snowflake
1659
+ around?: Snowflake
1660
+ };
1661
+
1662
+ type ChannelPosition = {
1663
+ channel: ChannelResolvable;
1664
+ position: number;
1665
+ };
1666
+
1667
+ type ChannelResolvable = Channel | Guild | Message | Snowflake;
1668
+
1669
+ type ClientOptions = {
1670
+ apiRequestMethod?: string;
1671
+ shardId?: number;
1672
+ shardCount?: number;
1673
+ messageCacheMaxSize?: number;
1674
+ messageCacheLifetime?: number;
1675
+ messageSweepInterval?: number;
1676
+ fetchAllMembers?: boolean;
1677
+ disableEveryone?: boolean;
1678
+ sync?: boolean;
1679
+ restWsBridgeTimeout?: number;
1680
+ restTimeOffset?: number;
1681
+ retryLimit?: number;
1682
+ disabledEvents?: WSEventType[];
1683
+ ws?: WebSocketOptions;
1684
+ http?: HTTPOptions;
1685
+ };
1686
+
1687
+ type CollectorHandler<K, V> = { key: K, value: V };
1688
+ type CollectorFilter = (...args: any[]) => boolean;
1689
+ type CollectorOptions = { time?: number };
1690
+
1691
+ type ColorResolvable = ('DEFAULT'
1692
+ | 'WHITE'
1693
+ | 'AQUA'
1694
+ | 'GREEN'
1695
+ | 'BLUE'
1696
+ | 'PURPLE'
1697
+ | 'LUMINOUS_VIVID_PINK'
1698
+ | 'GOLD'
1699
+ | 'ORANGE'
1700
+ | 'RED'
1701
+ | 'GREY'
1702
+ | 'DARKER_GREY'
1703
+ | 'NAVY'
1704
+ | 'DARK_AQUA'
1705
+ | 'DARK_GREEN'
1706
+ | 'DARK_BLUE'
1707
+ | 'DARK_PURPLE'
1708
+ | ' DARK_VIVID_PINK'
1709
+ | 'DARK_GOLD'
1710
+ | 'DARK_ORANGE'
1711
+ | 'DARK_RED'
1712
+ | 'DARK_GREY'
1713
+ | 'LIGHT_GREY'
1714
+ | 'DARK_NAVY'
1715
+ | 'RANDOM')
1716
+ | [number, number, number]
1717
+ | number
1718
+ | string;
1719
+
1720
+ type DeconstructedSnowflake = {
1721
+ timestamp: number;
1722
+ date: Date;
1723
+ workerID: number;
1724
+ processID: number;
1725
+ increment: number;
1726
+ binary: string;
1727
+ };
1728
+
1729
+ type DefaultMessageNotifications = 'ALL'
1730
+ | 'MENTIONS';
1731
+
1732
+ type EmojiEditData = {
1733
+ name?: string;
1734
+ roles?: Collection<Snowflake, Role> | Role[] | Snowflake[];
1735
+ };
1736
+
1737
+ type EmojiIdentifierResolvable = string | Emoji | ReactionEmoji;
1738
+
1739
+ type FileOptions = {
1740
+ attachment: BufferResolvable;
1741
+ name?: string;
1742
+ };
1743
+
1744
+ type GroupDMRecipientOptions = {
1745
+ user?: UserResolvable | Snowflake;
1746
+ accessToken?: string;
1747
+ nick?: string;
1748
+ };
1749
+
1750
+ type GuildAuditLogsAction = keyof GuildAuditLogsActions;
1751
+
1752
+ type GuildAuditLogsActions = {
1753
+ ALL?: null;
1754
+ GUILD_UPDATE?: number;
1755
+ CHANNEL_CREATE?: number;
1756
+ CHANNEL_UPDATE?: number;
1757
+ CHANNEL_DELETE?: number;
1758
+ CHANNEL_OVERWRITE_CREATE?: number;
1759
+ CHANNEL_OVERWRITE_UPDATE?: number;
1760
+ CHANNEL_OVERWRITE_DELETE?: number;
1761
+ MEMBER_KICK?: number;
1762
+ MEMBER_PRUNE?: number;
1763
+ MEMBER_BAN_ADD?: number;
1764
+ MEMBER_BAN_REMOVE?: number;
1765
+ MEMBER_UPDATE?: number;
1766
+ MEMBER_ROLE_UPDATE?: number;
1767
+ ROLE_CREATE?: number;
1768
+ ROLE_UPDATE?: number;
1769
+ ROLE_DELETE?: number;
1770
+ INVITE_CREATE?: number;
1771
+ INVITE_UPDATE?: number;
1772
+ INVITE_DELETE?: number;
1773
+ WEBHOOK_CREATE?: number;
1774
+ WEBHOOK_UPDATE?: number;
1775
+ WEBHOOK_DELETE?: number;
1776
+ EMOJI_CREATE?: number;
1777
+ EMOJI_UPDATE?: number;
1778
+ EMOJI_DELETE?: number;
1779
+ MESSAGE_DELETE?: number;
1780
+ };
1781
+
1782
+ type GuildAuditLogsActionType = 'CREATE'
1783
+ | 'DELETE'
1784
+ | 'UPDATE'
1785
+ | 'ALL';
1786
+
1787
+ type GuildAuditLogsFetchOptions = {
1788
+ before?: Snowflake | GuildAuditLogsEntry;
1789
+ after?: Snowflake | GuildAuditLogsEntry;
1790
+ limit?: number;
1791
+ user?: UserResolvable;
1792
+ type?: string | number;
1793
+ };
1794
+
1795
+ type GuildAuditLogsTarget = keyof GuildAuditLogsTargets;
1796
+
1797
+ type GuildAuditLogsTargets = {
1798
+ ALL?: string;
1799
+ GUILD?: string;
1800
+ CHANNEL?: string;
1801
+ USER?: string;
1802
+ ROLE?: string;
1803
+ INVITE?: string;
1804
+ WEBHOOK?: string;
1805
+ EMOJI?: string;
1806
+ MESSAGE?: string;
1807
+ };
1808
+
1809
+ type GuildChannelMessageNotifications = MessageNotifications
1810
+ & 'INHERIT';
1811
+
1812
+ type GuildEditData = {
1813
+ name?: string;
1814
+ region?: string;
1815
+ verificationLevel?: number;
1816
+ explicitContentFilter?: number;
1817
+ afkChannel?: ChannelResolvable;
1818
+ systemChannel?: ChannelResolvable;
1819
+ afkTimeout?: number;
1820
+ icon?: Base64Resolvable;
1821
+ owner?: GuildMemberResolvable;
1822
+ splash?: Base64Resolvable;
1823
+ };
1824
+
1825
+ type GuildEmbedData = {
1826
+ enabled: boolean;
1827
+ channel: ChannelResolvable;
1828
+ };
1829
+
1830
+ type GuildMemberEditData = {
1831
+ nick?: string;
1832
+ roles?: Collection<Snowflake, Role> | Role[] | Snowflake[];
1833
+ mute?: boolean;
1834
+ deaf?: boolean;
1835
+ channel?: ChannelResolvable | null;
1836
+ };
1837
+
1838
+ type GuildMemberResolvable = GuildMember | User;
1839
+
1840
+ type GuildResolvable = Guild | Snowflake;
1841
+
1842
+ type HTTPOptions = {
1843
+ version?: number;
1844
+ host?: string;
1845
+ cdn?: string;
1846
+ };
1847
+
1848
+ type InviteOptions = {
1849
+ temporary?: boolean;
1850
+ maxAge?: number;
1851
+ maxUses?: number;
1852
+ unique?: boolean;
1853
+ };
1854
+
1855
+ type InviteResolvable = string;
1856
+
1857
+ type MessageCollectorOptions = CollectorOptions & {
1858
+ max?: number;
1859
+ maxMatches?: number;
1860
+ };
1861
+
1862
+ type MessageEditOptions = {
1863
+ embed?: RichEmbedOptions;
1864
+ code?: string | boolean;
1865
+ };
1866
+
1867
+ type MessageNotifications = 'EVERYTHING'
1868
+ | 'MENTIONS'
1869
+ | 'NOTHING';
1870
+
1871
+ type MessageOptions = {
1872
+ tts?: boolean;
1873
+ nonce?: string;
1874
+ embed?: RichEmbed | RichEmbedOptions,
1875
+ disableEveryone?: boolean;
1876
+ file?: FileOptions | string;
1877
+ files?: (FileOptions | BufferResolvable | Attachment)[];
1878
+ code?: string | boolean;
1879
+ split?: boolean | SplitOptions;
1880
+ reply?: UserResolvable;
1881
+ };
1882
+
1883
+ type MessageSearchOptions = {
1884
+ content?: string;
1885
+ maxID?: Snowflake;
1886
+ minID?: Snowflake;
1887
+ has?: 'link'
1888
+ | 'embed'
1889
+ | 'file'
1890
+ | 'video'
1891
+ | 'image'
1892
+ | 'sound'
1893
+ | '-link'
1894
+ | '-embed'
1895
+ | '-file'
1896
+ | '-video'
1897
+ | '-image'
1898
+ | '-sound';
1899
+ channel?: ChannelResolvable;
1900
+ author?: UserResolvable;
1901
+ authorType?: 'user'
1902
+ | 'bot'
1903
+ | 'webhook'
1904
+ | '-user'
1905
+ | '-bot'
1906
+ | '-webhook';
1907
+ sortBy?: 'relevant' | 'recent';
1908
+ sortOrder?: 'asc' | 'desc';
1909
+ contextSize?: number;
1910
+ limit?: number;
1911
+ offset?: number;
1912
+ mentions?: UserResolvable;
1913
+ mentionsEveryone?: boolean;
1914
+ linkHostname?: string;
1915
+ embedProvider?: string;
1916
+ embedType?: 'image' | 'video' | 'url' | 'rich';
1917
+ attachmentFilename?: string;
1918
+ attachmentExtension?: string;
1919
+ before?: Date;
1920
+ after?: Date;
1921
+ during?: Date;
1922
+ nsfw?: boolean;
1923
+ };
1924
+
1925
+ type MessageSearchResult = {
1926
+ totalResults: number;
1927
+ messages: Message[][];
1928
+ };
1929
+
1930
+ type ActivityFlags = {
1931
+ INSTANCE?: number;
1932
+ JOIN?: number;
1933
+ SPECTATE?: number;
1934
+ JOIN_REQUEST?: number;
1935
+ SYNC?: number;
1936
+ PLAY?: number;
1937
+ };
1938
+
1939
+ type PermissionFlags = {
1940
+ ADMINISTRATOR?: number;
1941
+ CREATE_INSTANT_INVITE?: number;
1942
+ KICK_MEMBERS?: number;
1943
+ BAN_MEMBERS?: number;
1944
+ MANAGE_CHANNELS?: number;
1945
+ MANAGE_GUILD?: number;
1946
+ ADD_REACTIONS?: number;
1947
+ VIEW_AUDIT_LOG?: number;
1948
+ PRIORITY_SPEAKER?: number;
1949
+ VIEW_CHANNEL?: number;
1950
+ READ_MESSAGES?: number;
1951
+ SEND_MESSAGES?: number;
1952
+ SEND_TTS_MESSAGES?: number;
1953
+ MANAGE_MESSAGES?: number;
1954
+ EMBED_LINKS?: number;
1955
+ ATTACH_FILES?: number;
1956
+ READ_MESSAGE_HISTORY?: number;
1957
+ MENTION_EVERYONE?: number;
1958
+ USE_EXTERNAL_EMOJIS?: number;
1959
+ EXTERNAL_EMOJIS?: number;
1960
+ CONNECT?: number;
1961
+ SPEAK?: number;
1962
+ MUTE_MEMBERS?: number;
1963
+ DEAFEN_MEMBERS?: number;
1964
+ MOVE_MEMBERS?: number;
1965
+ USE_VAD?: number;
1966
+ CHANGE_NICKNAME?: number;
1967
+ MANAGE_NICKNAMES?: number;
1968
+ MANAGE_ROLES?: number;
1969
+ MANAGE_ROLES_OR_PERMISSIONS?: number;
1970
+ MANAGE_WEBHOOKS?: number;
1971
+ MANAGE_EMOJIS?: number;
1972
+ };
1973
+
1974
+ type PermissionObject = {
1975
+ ADMINISTRATOR?: boolean;
1976
+ CREATE_INSTANT_INVITE?: boolean;
1977
+ KICK_MEMBERS?: boolean;
1978
+ BAN_MEMBERS?: boolean;
1979
+ MANAGE_CHANNELS?: boolean;
1980
+ MANAGE_GUILD?: boolean;
1981
+ ADD_REACTIONS?: boolean;
1982
+ VIEW_AUDIT_LOG?: boolean;
1983
+ PRIORITY_SPEAKER?: boolean;
1984
+ VIEW_CHANNEL?: boolean;
1985
+ READ_MESSAGES?: boolean;
1986
+ SEND_MESSAGES?: boolean;
1987
+ SEND_TTS_MESSAGES?: boolean;
1988
+ MANAGE_MESSAGES?: boolean;
1989
+ EMBED_LINKS?: boolean;
1990
+ ATTACH_FILES?: boolean;
1991
+ READ_MESSAGE_HISTORY?: boolean;
1992
+ MENTION_EVERYONE?: boolean;
1993
+ USE_EXTERNAL_EMOJIS?: boolean;
1994
+ EXTERNAL_EMOJIS?: boolean;
1995
+ CONNECT?: boolean;
1996
+ SPEAK?: boolean;
1997
+ MUTE_MEMBERS?: boolean;
1998
+ DEAFEN_MEMBERS?: boolean;
1999
+ MOVE_MEMBERS?: boolean;
2000
+ USE_VAD?: boolean;
2001
+ CHANGE_NICKNAME?: boolean;
2002
+ MANAGE_NICKNAMES?: boolean;
2003
+ MANAGE_ROLES?: boolean;
2004
+ MANAGE_ROLES_OR_PERMISSIONS?: boolean;
2005
+ MANAGE_WEBHOOKS?: boolean;
2006
+ MANAGE_EMOJIS?: boolean;
2007
+ };
2008
+
2009
+ type PermissionString = 'ADMINISTRATOR'
2010
+ | 'CREATE_INSTANT_INVITE'
2011
+ | 'KICK_MEMBERS'
2012
+ | 'BAN_MEMBERS'
2013
+ | 'MANAGE_CHANNELS'
2014
+ | 'MANAGE_GUILD'
2015
+ | 'ADD_REACTIONS'
2016
+ | 'VIEW_AUDIT_LOG'
2017
+ | 'PRIORITY_SPEAKER'
2018
+ | 'VIEW_CHANNEL'
2019
+ | 'READ_MESSAGES'
2020
+ | 'SEND_MESSAGES'
2021
+ | 'SEND_TTS_MESSAGES'
2022
+ | 'MANAGE_MESSAGES'
2023
+ | 'EMBED_LINKS'
2024
+ | 'ATTACH_FILES'
2025
+ | 'READ_MESSAGE_HISTORY'
2026
+ | 'MENTION_EVERYONE'
2027
+ | 'USE_EXTERNAL_EMOJIS'
2028
+ | 'EXTERNAL_EMOJIS'
2029
+ | 'CONNECT'
2030
+ | 'SPEAK'
2031
+ | 'MUTE_MEMBERS'
2032
+ | 'DEAFEN_MEMBERS'
2033
+ | 'MOVE_MEMBERS'
2034
+ | 'USE_VAD'
2035
+ | 'CHANGE_NICKNAME'
2036
+ | 'MANAGE_NICKNAMES'
2037
+ | 'MANAGE_ROLES'
2038
+ | 'MANAGE_ROLES_OR_PERMISSIONS'
2039
+ | 'MANAGE_WEBHOOKS'
2040
+ | 'MANAGE_EMOJIS';
2041
+
2042
+ type PermissionOverwriteOptions = PermissionObject;
2043
+
2044
+ interface RecursiveArray<T> extends Array<T | RecursiveArray<T>> { }
2045
+
2046
+ type PermissionResolvable = RecursiveArray<Permissions | PermissionString | number> | Permissions | PermissionString | number;
2047
+
2048
+ type PresenceData = {
2049
+ status?: PresenceStatus;
2050
+ afk?: boolean;
2051
+ game?: {
2052
+ name?: string;
2053
+ url?: string;
2054
+ type?: ActivityType;
2055
+ } | null;
2056
+ };
2057
+
2058
+ type ClientPresenceStatus = 'online' | 'idle' | 'dnd';
2059
+
2060
+ type PresenceStatus = ClientPresenceStatus | 'invisible';
2061
+ type PresenceStatusData = ClientPresenceStatus | 'offline';
2062
+
2063
+ type ClientPresenceStatusData = {
2064
+ web?: ClientPresenceStatus;
2065
+ mobile?: ClientPresenceStatus;
2066
+ desktop?: ClientPresenceStatus;
2067
+ };
2068
+
2069
+ type RateLimitInfo = {
2070
+ limit: number;
2071
+ timeDifference: number;
2072
+ method: string;
2073
+ path: string;
2074
+ };
2075
+
2076
+ type ReactionCollectorOptions = CollectorOptions & {
2077
+ max?: number;
2078
+ maxEmojis?: number;
2079
+ maxUsers?: number;
2080
+ };
2081
+
2082
+ type RichEmbedOptions = {
2083
+ title?: string;
2084
+ description?: string;
2085
+ url?: string;
2086
+ timestamp?: Date;
2087
+ color?: number | string;
2088
+ fields?: { name: string; value: string; inline?: boolean; }[];
2089
+ file?: Attachment | string | FileOptions;
2090
+ author?: { name: string; url?: string; icon_url?: string; };
2091
+ thumbnail?: { url: string; height?: number; width?: number; };
2092
+ image?: { url: string; proxy_url?: string; height?: number; width?: number; };
2093
+ video?: { url: string; height: number; width: number; };
2094
+ footer?: { text?: string; icon_url?: string; };
2095
+ };
2096
+
2097
+ type RoleData = {
2098
+ name?: string;
2099
+ color?: ColorResolvable;
2100
+ hoist?: boolean;
2101
+ position?: number;
2102
+ permissions?: PermissionResolvable;
2103
+ mentionable?: boolean;
2104
+ };
2105
+
2106
+ type RoleResolvable = Role | string;
2107
+
2108
+ type Snowflake = string;
2109
+
2110
+ type SplitOptions = {
2111
+ maxLength?: number;
2112
+ char?: string;
2113
+ prepend?: string;
2114
+ append?: string;
2115
+ };
2116
+
2117
+ type Status = number;
2118
+
2119
+ type StreamOptions = {
2120
+ seek?: number;
2121
+ volume?: number;
2122
+ passes?: number;
2123
+ bitrate?: number | 'auto';
2124
+ };
2125
+
2126
+ type StringResolvable = string | string[] | any;
2127
+
2128
+ type UserResolvable = User | Snowflake | Message | Guild | GuildMember;
2129
+
2130
+ type VoiceStatus = number;
2131
+
2132
+ type WebhookMessageOptions = {
2133
+ username?: string;
2134
+ avatarURL?: string;
2135
+ tts?: boolean;
2136
+ nonce?: string;
2137
+ embeds?: (RichEmbed | object)[];
2138
+ disableEveryone?: boolean;
2139
+ file?: FileOptions | BufferResolvable | Attachment;
2140
+ files?: (FileOptions | BufferResolvable | Attachment)[];
2141
+ code?: string | boolean;
2142
+ split?: boolean | SplitOptions;
2143
+ };
2144
+
2145
+ type WebSocketOptions = {
2146
+ large_threshold?: number;
2147
+ compress?: boolean;
2148
+ };
2149
+
2150
+ type WSEventType = 'READY'
2151
+ | 'RESUMED'
2152
+ | 'GUILD_SYNC'
2153
+ | 'GUILD_CREATE'
2154
+ | 'GUILD_DELETE'
2155
+ | 'GUILD_UPDATE'
2156
+ | 'GUILD_MEMBER_ADD'
2157
+ | 'GUILD_MEMBER_REMOVE'
2158
+ | 'GUILD_MEMBER_UPDATE'
2159
+ | 'GUILD_MEMBERS_CHUNK'
2160
+ | 'GUILD_INTEGRATIONS_UPDATE'
2161
+ | 'GUILD_ROLE_CREATE'
2162
+ | 'GUILD_ROLE_DELETE'
2163
+ | 'GUILD_ROLE_UPDATE'
2164
+ | 'GUILD_BAN_ADD'
2165
+ | 'GUILD_BAN_REMOVE'
2166
+ | 'CHANNEL_CREATE'
2167
+ | 'CHANNEL_DELETE'
2168
+ | 'CHANNEL_UPDATE'
2169
+ | 'CHANNEL_PINS_UPDATE'
2170
+ | 'MESSAGE_CREATE'
2171
+ | 'MESSAGE_DELETE'
2172
+ | 'MESSAGE_UPDATE'
2173
+ | 'MESSAGE_DELETE_BULK'
2174
+ | 'MESSAGE_REACTION_ADD'
2175
+ | 'MESSAGE_REACTION_REMOVE'
2176
+ | 'MESSAGE_REACTION_REMOVE_ALL'
2177
+ | 'USER_UPDATE'
2178
+ | 'USER_NOTE_UPDATE'
2179
+ | 'USER_SETTINGS_UPDATE'
2180
+ | 'USER_GUILD_SETTINGS_UPDATE'
2181
+ | 'PRESENCE_UPDATE'
2182
+ | 'VOICE_STATE_UPDATE'
2183
+ | 'TYPING_START'
2184
+ | 'VOICE_SERVER_UPDATE'
2185
+ | 'WEBHOOKS_UPDATE'
2186
+ | 'RELATIONSHIP_ADD'
2187
+ | 'RELATIONSHIP_REMOVE';
2188
+
2189
+ //#endregion
2190
+ }