oceanic.js 1.10.3-dev.c6c9f52 → 1.10.3-dev.ca8b6e8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/dist/lib/Client.d.ts +99 -0
  2. package/dist/lib/Client.js +263 -0
  3. package/dist/lib/Constants.d.ts +1215 -0
  4. package/dist/lib/Constants.js +1513 -0
  5. package/dist/lib/gateway/Shard.d.ts +83 -0
  6. package/dist/lib/gateway/Shard.js +1621 -0
  7. package/dist/lib/gateway/ShardManager.d.ts +29 -0
  8. package/dist/lib/gateway/ShardManager.js +300 -0
  9. package/dist/lib/index.d.ts +84 -0
  10. package/dist/lib/index.js +168 -0
  11. package/dist/lib/rest/Bucket.d.ts +33 -0
  12. package/dist/lib/rest/Bucket.js +78 -0
  13. package/dist/lib/rest/DiscordHTTPError.d.ts +16 -0
  14. package/dist/lib/rest/DiscordHTTPError.js +65 -0
  15. package/dist/lib/rest/DiscordRESTError.d.ts +19 -0
  16. package/dist/lib/rest/DiscordRESTError.js +89 -0
  17. package/dist/lib/rest/OAuthHelper.d.ts +62 -0
  18. package/dist/lib/rest/OAuthHelper.js +183 -0
  19. package/dist/lib/rest/RESTManager.d.ts +42 -0
  20. package/dist/lib/rest/RESTManager.js +82 -0
  21. package/dist/lib/rest/RequestHandler.d.ts +28 -0
  22. package/dist/lib/rest/RequestHandler.js +313 -0
  23. package/dist/lib/rest/SequentialBucket.d.ts +25 -0
  24. package/dist/lib/rest/SequentialBucket.js +76 -0
  25. package/dist/lib/routes/Applications.d.ts +171 -0
  26. package/dist/lib/routes/Applications.js +447 -0
  27. package/dist/lib/routes/Channels.d.ts +408 -0
  28. package/dist/lib/routes/Channels.js +1160 -0
  29. package/dist/lib/routes/Guilds.d.ts +606 -0
  30. package/dist/lib/routes/Guilds.js +1669 -0
  31. package/dist/lib/routes/Interactions.d.ts +74 -0
  32. package/dist/lib/routes/Interactions.js +141 -0
  33. package/dist/lib/routes/Miscellaneous.d.ts +31 -0
  34. package/dist/lib/routes/Miscellaneous.js +69 -0
  35. package/dist/lib/routes/OAuth.d.ts +108 -0
  36. package/dist/lib/routes/OAuth.js +312 -0
  37. package/dist/lib/routes/Users.d.ts +32 -0
  38. package/dist/lib/routes/Users.js +59 -0
  39. package/dist/lib/routes/Webhooks.d.ts +128 -0
  40. package/dist/lib/routes/Webhooks.js +265 -0
  41. package/dist/lib/structures/AnnouncementChannel.d.ts +36 -0
  42. package/dist/lib/structures/AnnouncementChannel.js +47 -0
  43. package/dist/lib/structures/AnnouncementThreadChannel.d.ts +18 -0
  44. package/dist/lib/structures/AnnouncementThreadChannel.js +27 -0
  45. package/dist/lib/structures/Application.d.ts +102 -0
  46. package/dist/lib/structures/Application.js +189 -0
  47. package/dist/lib/structures/ApplicationCommand.d.ts +74 -0
  48. package/dist/lib/structures/ApplicationCommand.js +141 -0
  49. package/dist/lib/structures/Attachment.d.ts +34 -0
  50. package/dist/lib/structures/Attachment.js +64 -0
  51. package/dist/lib/structures/AuditLogEntry.d.ts +25 -0
  52. package/dist/lib/structures/AuditLogEntry.js +53 -0
  53. package/dist/lib/structures/AutoModerationRule.d.ts +49 -0
  54. package/dist/lib/structures/AutoModerationRule.js +139 -0
  55. package/dist/lib/structures/AutocompleteInteraction.d.ts +62 -0
  56. package/dist/lib/structures/AutocompleteInteraction.js +115 -0
  57. package/dist/lib/structures/Base.d.ts +20 -0
  58. package/dist/lib/structures/Base.js +58 -0
  59. package/dist/lib/structures/BaseEntitlement.d.ts +19 -0
  60. package/dist/lib/structures/BaseEntitlement.js +44 -0
  61. package/dist/lib/structures/CategoryChannel.d.ts +41 -0
  62. package/dist/lib/structures/CategoryChannel.js +105 -0
  63. package/dist/lib/structures/Channel.d.ts +20 -0
  64. package/dist/lib/structures/Channel.js +91 -0
  65. package/dist/lib/structures/ClientApplication.d.ts +153 -0
  66. package/dist/lib/structures/ClientApplication.js +220 -0
  67. package/dist/lib/structures/CommandInteraction.d.ts +127 -0
  68. package/dist/lib/structures/CommandInteraction.js +297 -0
  69. package/dist/lib/structures/ComponentInteraction.d.ts +137 -0
  70. package/dist/lib/structures/ComponentInteraction.js +311 -0
  71. package/dist/lib/structures/Entitlement.d.ts +12 -0
  72. package/dist/lib/structures/Entitlement.js +26 -0
  73. package/dist/lib/structures/ExtendedUser.d.ts +26 -0
  74. package/dist/lib/structures/ExtendedUser.js +57 -0
  75. package/dist/lib/structures/ForumChannel.d.ts +11 -0
  76. package/dist/lib/structures/ForumChannel.js +19 -0
  77. package/dist/lib/structures/GroupChannel.d.ts +62 -0
  78. package/dist/lib/structures/GroupChannel.js +133 -0
  79. package/dist/lib/structures/Guild.d.ts +654 -0
  80. package/dist/lib/structures/Guild.js +1319 -0
  81. package/dist/lib/structures/GuildChannel.d.ts +34 -0
  82. package/dist/lib/structures/GuildChannel.js +75 -0
  83. package/dist/lib/structures/GuildPreview.d.ts +50 -0
  84. package/dist/lib/structures/GuildPreview.js +119 -0
  85. package/dist/lib/structures/GuildScheduledEvent.d.ts +60 -0
  86. package/dist/lib/structures/GuildScheduledEvent.js +154 -0
  87. package/dist/lib/structures/GuildTemplate.d.ts +55 -0
  88. package/dist/lib/structures/GuildTemplate.js +126 -0
  89. package/dist/lib/structures/Integration.d.ts +54 -0
  90. package/dist/lib/structures/Integration.js +156 -0
  91. package/dist/lib/structures/Interaction.d.ts +40 -0
  92. package/dist/lib/structures/Interaction.js +90 -0
  93. package/dist/lib/structures/InteractionResolvedChannel.d.ts +28 -0
  94. package/dist/lib/structures/InteractionResolvedChannel.js +45 -0
  95. package/dist/lib/structures/Invite.d.ts +64 -0
  96. package/dist/lib/structures/Invite.js +193 -0
  97. package/dist/lib/structures/InviteGuild.d.ts +52 -0
  98. package/dist/lib/structures/InviteGuild.js +88 -0
  99. package/dist/lib/structures/MediaChannel.d.ts +11 -0
  100. package/dist/lib/structures/MediaChannel.js +19 -0
  101. package/dist/lib/structures/Member.d.ts +122 -0
  102. package/dist/lib/structures/Member.js +255 -0
  103. package/dist/lib/structures/Message.d.ts +194 -0
  104. package/dist/lib/structures/Message.js +477 -0
  105. package/dist/lib/structures/ModalSubmitInteraction.d.ts +128 -0
  106. package/dist/lib/structures/ModalSubmitInteraction.js +240 -0
  107. package/dist/lib/structures/OAuthApplication.d.ts +79 -0
  108. package/dist/lib/structures/OAuthApplication.js +210 -0
  109. package/dist/lib/structures/OAuthGuild.d.ts +35 -0
  110. package/dist/lib/structures/OAuthGuild.js +61 -0
  111. package/dist/lib/structures/PartialApplication.d.ts +30 -0
  112. package/dist/lib/structures/PartialApplication.js +67 -0
  113. package/dist/lib/structures/Permission.d.ts +21 -0
  114. package/dist/lib/structures/Permission.js +68 -0
  115. package/dist/lib/structures/PermissionOverwrite.d.ts +26 -0
  116. package/dist/lib/structures/PermissionOverwrite.js +49 -0
  117. package/dist/lib/structures/PingInteraction.d.ts +16 -0
  118. package/dist/lib/structures/PingInteraction.js +26 -0
  119. package/dist/lib/structures/Poll.d.ts +28 -0
  120. package/dist/lib/structures/Poll.js +78 -0
  121. package/dist/lib/structures/PrivateChannel.d.ts +90 -0
  122. package/dist/lib/structures/PrivateChannel.js +131 -0
  123. package/dist/lib/structures/PrivateThreadChannel.d.ts +18 -0
  124. package/dist/lib/structures/PrivateThreadChannel.js +27 -0
  125. package/dist/lib/structures/PublicThreadChannel.d.ts +21 -0
  126. package/dist/lib/structures/PublicThreadChannel.js +37 -0
  127. package/dist/lib/structures/Role.d.ts +52 -0
  128. package/dist/lib/structures/Role.js +137 -0
  129. package/dist/lib/structures/SKU.d.ts +32 -0
  130. package/dist/lib/structures/SKU.js +53 -0
  131. package/dist/lib/structures/StageChannel.d.ts +33 -0
  132. package/dist/lib/structures/StageChannel.js +44 -0
  133. package/dist/lib/structures/StageInstance.d.ts +36 -0
  134. package/dist/lib/structures/StageInstance.js +94 -0
  135. package/dist/lib/structures/Team.d.ts +22 -0
  136. package/dist/lib/structures/Team.js +67 -0
  137. package/dist/lib/structures/TestEntitlement.d.ts +10 -0
  138. package/dist/lib/structures/TestEntitlement.js +21 -0
  139. package/dist/lib/structures/TextChannel.d.ts +34 -0
  140. package/dist/lib/structures/TextChannel.js +46 -0
  141. package/dist/lib/structures/TextableChannel.d.ts +158 -0
  142. package/dist/lib/structures/TextableChannel.js +276 -0
  143. package/dist/lib/structures/TextableVoiceChannel.d.ts +39 -0
  144. package/dist/lib/structures/TextableVoiceChannel.js +81 -0
  145. package/dist/lib/structures/ThreadChannel.d.ts +159 -0
  146. package/dist/lib/structures/ThreadChannel.js +295 -0
  147. package/dist/lib/structures/ThreadOnlyChannel.d.ts +99 -0
  148. package/dist/lib/structures/ThreadOnlyChannel.js +233 -0
  149. package/dist/lib/structures/ThreadableChannel.d.ts +36 -0
  150. package/dist/lib/structures/ThreadableChannel.js +58 -0
  151. package/dist/lib/structures/UnavailableGuild.d.ts +11 -0
  152. package/dist/lib/structures/UnavailableGuild.js +21 -0
  153. package/dist/lib/structures/User.d.ts +82 -0
  154. package/dist/lib/structures/User.js +168 -0
  155. package/dist/lib/structures/VoiceChannel.d.ts +20 -0
  156. package/dist/lib/structures/VoiceChannel.js +35 -0
  157. package/dist/lib/structures/VoiceState.d.ts +51 -0
  158. package/dist/lib/structures/VoiceState.js +140 -0
  159. package/dist/lib/structures/Webhook.d.ts +129 -0
  160. package/dist/lib/structures/Webhook.js +206 -0
  161. package/dist/lib/types/applications.d.ts +466 -0
  162. package/dist/lib/types/audit-log.d.ts +122 -0
  163. package/dist/lib/types/auto-moderation.d.ts +99 -0
  164. package/dist/lib/types/channels.d.ts +1244 -0
  165. package/dist/lib/types/client.d.ts +228 -0
  166. package/dist/lib/types/events.d.ts +265 -0
  167. package/dist/lib/types/gateway-raw.d.ts +584 -0
  168. package/dist/lib/types/gateway.d.ts +351 -0
  169. package/dist/lib/types/guild-template.d.ts +33 -0
  170. package/dist/lib/types/guilds.d.ts +855 -0
  171. package/dist/lib/types/index.d.ts +18 -0
  172. package/dist/lib/types/interactions.d.ts +377 -0
  173. package/dist/lib/types/json.d.ts +742 -0
  174. package/dist/lib/types/misc.d.ts +28 -0
  175. package/dist/lib/types/oauth.d.ts +201 -0
  176. package/dist/lib/types/request-handler.d.ts +52 -0
  177. package/dist/lib/types/scheduled-events.d.ts +88 -0
  178. package/dist/lib/types/shared.d.ts +9 -0
  179. package/dist/lib/types/users.d.ts +45 -0
  180. package/dist/lib/types/voice.d.ts +45 -0
  181. package/dist/lib/types/webhooks.d.ts +74 -0
  182. package/dist/lib/util/Collection.d.ts +47 -0
  183. package/dist/lib/util/Collection.js +78 -0
  184. package/dist/lib/util/Errors.d.ts +29 -0
  185. package/dist/lib/util/Errors.js +56 -0
  186. package/dist/lib/util/Routes.d.ts +127 -0
  187. package/dist/lib/util/Routes.js +248 -0
  188. package/dist/lib/util/SimpleCollection.d.ts +12 -0
  189. package/dist/lib/util/SimpleCollection.js +81 -0
  190. package/dist/lib/util/TypedCollection.d.ts +24 -0
  191. package/dist/lib/util/TypedCollection.js +76 -0
  192. package/dist/lib/util/TypedEmitter.d.ts +19 -0
  193. package/dist/lib/util/TypedEmitter.js +19 -0
  194. package/dist/lib/util/Util.d.ts +58 -0
  195. package/dist/lib/util/Util.js +535 -0
  196. package/dist/lib/util/interactions/InteractionOptionsWrapper.d.ts +170 -0
  197. package/dist/lib/util/interactions/InteractionOptionsWrapper.js +213 -0
  198. package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +24 -0
  199. package/dist/lib/util/interactions/MessageInteractionResponse.js +28 -0
  200. package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +24 -0
  201. package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.js +34 -0
  202. package/dist/lib/util/interactions/SelectMenuValuesWrapper.d.ts +60 -0
  203. package/dist/lib/util/interactions/SelectMenuValuesWrapper.js +124 -0
  204. package/dist/package.json +1 -1
  205. package/package.json +1 -1
@@ -0,0 +1,351 @@
1
+ /** @module Types/Gateway */
2
+ import type { PartialEmoji } from ".";
3
+ import type { RawUser } from "./users";
4
+ import type { AutoModerationAction, RawAutoModerationAction } from "./auto-moderation";
5
+ import type {
6
+ ActivityTypes,
7
+ AnimationTypes,
8
+ AutoModerationTriggerTypes,
9
+ ChannelTypes,
10
+ IntentNames
11
+ } from "../Constants";
12
+ import type AutoModerationRule from "../structures/AutoModerationRule";
13
+ import type Shard from "../gateway/Shard";
14
+ import type { ClientOptions as WSClientOptions } from "ws";
15
+
16
+ export type ReconnectDelayFunction = (lastDelay: number, attempts: number) => number;
17
+ export type GetGatewayOverrideFunction = () => GetGatewayResponse;
18
+ export type GetBotGatewayOverrideFunction = (response: GetBotGatewayResponse) => GetBotGatewayResponse;
19
+ export type GetBotGatewayFullOverrideFunction = () => GetBotGatewayResponse;
20
+ interface GatewayOptions {
21
+ /**
22
+ * If dropped connections should be automatically reconnected.
23
+ * @defaultValue true
24
+ */
25
+ autoReconnect?: boolean;
26
+ /**
27
+ * If packets to and from Discord should be compressed.
28
+ * @defaultValue false
29
+ */
30
+ compress?: boolean;
31
+ /**
32
+ * The concurrency for shard connections. If you don't know what this is, don't mess with it. Only bots in >150,000 servers can use any non-default value.
33
+ * @defaultValue 1
34
+ */
35
+ concurrency?: number | "auto";
36
+ /**
37
+ * The `properties` used when identifying.
38
+ */
39
+ connectionProperties?: {
40
+ /**
41
+ * The browser of the client. For example, "Discord Android" or "Discord iOS" to show as mobile.
42
+ * @defaultValue Oceanic
43
+ */
44
+ browser?: string;
45
+ /**
46
+ * The device of the client.
47
+ * @defaultValue Oceanic
48
+ */
49
+ device?: string;
50
+ /**
51
+ * The operating system of the client.
52
+ * @defaultValue `process.platform()`
53
+ */
54
+ os?: string;
55
+ };
56
+ /**
57
+ * The maximum amount of time in milliseconds to wait for a connection to be established.
58
+ * @defaultValue 30000
59
+ */
60
+ connectionTimeout?: number;
61
+ /**
62
+ * The ID of the first shard to run for this client. Mutually exclusive with `shardIDs`.
63
+ * @defaultValue 0
64
+ */
65
+ firstShardID?: number;
66
+ /**
67
+ * If the members of all guilds should be requested. Requires the `GUILD_MEMBERS` intent.
68
+ * @defaultValue false
69
+ */
70
+ getAllUsers?: boolean;
71
+ /**
72
+ * The time in milliseconds after which the client will consider all guilds to have been received.
73
+ * @defaultValue 2000
74
+ */
75
+ guildCreateTimeout?: number;
76
+ /**
77
+ * The [intents](https://discord.com/developers/docs/topics/gateway#list-of-intents) to use. Either a number, array of intent names, array of numbers, or "ALL"/"ALL_NON_PRIVILEGED". All non privileged intents are used by default.
78
+ * @defaultValue {@link Constants~AllNonPrivilegedIntents | All Non Privileged Intents}
79
+ */
80
+ intents?: number | Array<IntentNames | "ALL" | "ALL_NON_PRIVILEGED" | number>;
81
+ /**
82
+ * The threshold at which guilds are considered "large" (after which offline members will not be loaded).
83
+ * @defaultValue 250
84
+ */
85
+ largeThreshold?: number;
86
+ /**
87
+ * The ID of the last shard to run for this client. Mutually exclusive with `shardIDs`.
88
+ * @defaultValue maxShards - 1
89
+ */
90
+ lastShardID?: number;
91
+ /**
92
+ * If upon recieving a disconnect for disallowed intents, we should request the application's flags and list the privileged intents that are missing in the error. This requires making a request to {@link REST/Applications.getCurrent | `/applications/@me`}.
93
+ * @defaultValue false
94
+ */
95
+ lookupDisallowedIntents?: boolean;
96
+ /**
97
+ * The maximum number of attempts to reconnect.
98
+ * @defaultValue Infinity
99
+ */
100
+ maxReconnectAttempts?: number;
101
+ /**
102
+ * The maximum number of attempts to resume a lost connection.
103
+ * @defaultValue 10
104
+ */
105
+ maxResumeAttempts?: number;
106
+ /**
107
+ * The total number of shards across all running clients. Limit the number of shards per client via `firstShardID` & `lastShardID`.
108
+ * @defaultValue 1
109
+ */
110
+ maxShards?: number | "auto";
111
+ /** Options for overriding default gateway behavior. */
112
+ override?: OverrideOptions;
113
+ /** The initial presence to use when connecting. */
114
+ presence?: UpdatePresenceOptions;
115
+ /**
116
+ * A function to calculate the delay between reconnect attempts.
117
+ * @defaultValue (lastDelay, attempts) => Math.pow(attempts + 1, 0.7) * 20000
118
+ */
119
+ reconnectDelay?: ReconnectDelayFunction;
120
+ /**
121
+ * If a check should be made before connecting, which will remove any disallowed intents. This requires making a request to {@link REST/Applications.getCurrent | `/applications/@me`}. Any removed intents will be emitted via the `warn` event.
122
+ * @defaultValue false
123
+ */
124
+ removeDisallowedIntents?: boolean;
125
+ /**
126
+ * If existing voice connections should be populated. This will disconnect connections from other sessions.
127
+ * @defaultValue false
128
+ */
129
+ seedVoiceConnections?: boolean;
130
+ /**
131
+ * An array of shard IDs to run for this client. Mutually exclusive with `firstShardID` & `lastShardID`.
132
+ * @defaultValue based on `firstShardID` & `lastShardID`
133
+ */
134
+ shardIDs?: Array<number>;
135
+ /** The options to pass to constructed websockets. */
136
+ ws?: WSClientOptions;
137
+ }
138
+
139
+ export interface OverrideOptions {
140
+ /**
141
+ * If the compression/version information should be appended to the query.
142
+ * @defaultValue true if `getBot` and `url` are undefined, false otherwise
143
+ */
144
+ appendQuery?: boolean;
145
+ /**
146
+ * If the gateway url should be used for resuming.
147
+ * @defaultValue false if `getBot` or `url` are present, true otherwise
148
+ */
149
+ gatewayURLIsResumeURL?: boolean;
150
+ /**
151
+ * The amount time in milliseconds to wait between shard connects. Discord only allows one connection per 5 seconds.
152
+ * @defaultValue 5000
153
+ */
154
+ timeBetweenShardConnects?: number;
155
+ /** Replaces the response normally recieved from `GET /gateway/bot`. The `url` function below will override the value returned here. */
156
+ getBot?(): Promise<GetBotGatewayResponse>;
157
+ /** Replaces the `resume_url` recieved from Discord. */
158
+ resumeURL?(shard: Shard, totalShards: number): Promise<string>;
159
+ /** Replaces the gateway url shards connect to. This WILL be called multiple times if you have more than one shard, be sure to cache its results if you do anythng that isn't quickly repeatable. */
160
+ url?(shard: Shard, totalShards: number): Promise<string>;
161
+ }
162
+
163
+ export interface ShardManagerInstanceOptions extends Required<Omit<GatewayOptions, "concurrency" | "connectionProperties" | "intents" | "maxShards" | "presence" | "override">> {
164
+ concurrency: number;
165
+ connectionProperties: Required<GatewayOptions["connectionProperties"]>;
166
+ intents: number;
167
+ maxShards: number;
168
+ override: Omit<OverrideOptions, "appendQuery" | "gatewayURLIsResumeURL" | "timeBetweenShardConnects"> & Required<Pick<OverrideOptions, "appendQuery" | "gatewayURLIsResumeURL" | "timeBetweenShardConnects">>;
169
+ presence: Required<UpdatePresenceOptions>;
170
+ }
171
+
172
+ export interface GetGatewayResponse {
173
+ url: string;
174
+ }
175
+
176
+ export interface RawGetBotGatewayResponse extends GetGatewayResponse {
177
+ session_start_limit: RawSessionStartLimit;
178
+ shards: number;
179
+ }
180
+
181
+ export interface RawSessionStartLimit {
182
+ max_concurrency: number;
183
+ remaining: number;
184
+ reset_after: number;
185
+ total: number;
186
+ }
187
+
188
+ export interface SessionStartLimit {
189
+ maxConcurrency: number;
190
+ remaining: number;
191
+ resetAfter: number;
192
+ total: number;
193
+ }
194
+
195
+
196
+ export interface GetBotGatewayResponse extends GetGatewayResponse {
197
+ sessionStartLimit: SessionStartLimit;
198
+ shards: number;
199
+ }
200
+
201
+ export interface RequestGuildMembersOptions {
202
+ /** The maximum number of members to request. */
203
+ limit?: number;
204
+ /**
205
+ * If presences should be requested. Requires the `GUILD_PRESENCES` intent.
206
+ * @defaultValue false
207
+ */
208
+ presences?: boolean;
209
+ /** If provided, only members with a username that starts with this string will be returned. If empty or not provided, requires the `GUILD_MEMBERS` intent. */
210
+ query?: string;
211
+ /**
212
+ * The maximum amount of time in milliseconds to wait.
213
+ * @defaultValue `client.rest.options.requestTimeout`
214
+ */
215
+ timeout?: number;
216
+ /** The IDs of up to 100 users to specifically request. */
217
+ userIDs?: Array<string>;
218
+ }
219
+
220
+ export type MutualStatuses = "online" | "dnd" | "idle";
221
+ export type SendStatuses = MutualStatuses | "invisible";
222
+ export type ReceiveStatuses = MutualStatuses | "offline";
223
+
224
+ export interface UpdatePresenceOptions {
225
+ /** An array of activities. */
226
+ activities?: Array<BotActivity>;
227
+ /** If the client is afk. */
228
+ afk?: boolean;
229
+ /** The [status](https://discord.com/developers/docs/topics/gateway#update-presence-status-types). */
230
+ status: SendStatuses;
231
+ }
232
+
233
+ export interface Activity {
234
+ application_id?: string;
235
+ assets?: Partial<Record<"large_image" | "large_text" | "small_image" | "small_text", string>>;
236
+ buttons?: Array<ActivityButton>;
237
+ created_at: number;
238
+ details?: string | null;
239
+ emoji?: ActivityEmoji | null;
240
+ flags?: number;
241
+ instance?: boolean;
242
+ name: string;
243
+ party?: ActivityParty;
244
+ secrets?: Partial<Record<"join" | "spectate" | "match", string>>;
245
+ state?: string | null;
246
+ timestamps?: Partial<Record<"end" | "start", number>>;
247
+ type: ActivityTypes;
248
+ url?: string | null;
249
+ }
250
+ export interface BotActivity extends Pick<Activity, "name" | "url" | "state" | "type"> {}
251
+
252
+ export interface ActivityEmoji {
253
+ animated?: boolean;
254
+ id?: string;
255
+ name: string;
256
+ }
257
+
258
+ export interface ActivityParty {
259
+ id?: string;
260
+ size?: [currentSize: number, maxSize: number];
261
+ }
262
+
263
+ export interface ActivityButton {
264
+ label: string;
265
+ url: string;
266
+ }
267
+
268
+ export interface PresenceUpdate {
269
+ activities?: Array<Activity>;
270
+ client_status: ClientStatus;
271
+ guild_id: string;
272
+ status: ReceiveStatuses;
273
+ user: { id: string; } & Partial<Omit<RawUser, "id">>;
274
+ }
275
+
276
+ export interface ClientStatus {
277
+ desktop?: string;
278
+ mobile?: string;
279
+ web?: string;
280
+ }
281
+
282
+ export interface UpdateVoiceStateOptions {
283
+ /** If the client should be self deafened. */
284
+ selfDeaf?: boolean;
285
+ /** If the client should be self muted. */
286
+ selfMute?: boolean;
287
+ }
288
+
289
+ export interface RawAutoModerationActionExecution {
290
+ action: RawAutoModerationAction;
291
+ alert_system_message_id?: string;
292
+ channel_id?: string;
293
+ content: string;
294
+ guild_id: string;
295
+ matched_content: string;
296
+ matched_keyword: string | null;
297
+ message_id?: string;
298
+ rule_id: string;
299
+ rule_trigger_type: AutoModerationTriggerTypes;
300
+ user_id: string;
301
+ }
302
+
303
+ export interface AutoModerationActionExecution {
304
+ action: AutoModerationAction;
305
+ alertSystemMessageID?: string;
306
+ content: string;
307
+ matchedContent: string;
308
+ matchedKeyword: string | null;
309
+ messageID?: string;
310
+ rule?: AutoModerationRule;
311
+ ruleID: string;
312
+ ruleTriggerType: AutoModerationTriggerTypes;
313
+ }
314
+
315
+ export type ShardStatus = "connecting" | "disconnected" | "handshaking" | "identifying" | "ready" | "resuming";
316
+
317
+ export interface RawDeletedPrivateChannel {
318
+ flags: number;
319
+ id: string;
320
+ last_message_id: string | null;
321
+ type: ChannelTypes.DM;
322
+ }
323
+
324
+ export interface DeletedPrivateChannel {
325
+ flags: number;
326
+ id: string;
327
+ lastMessageID: string | null;
328
+ type: ChannelTypes.DM;
329
+ }
330
+
331
+ export interface RawVoiceChannelEffect {
332
+ animation_id?: number;
333
+ animation_type?: AnimationTypes;
334
+ channel_id: string;
335
+ emoji?: PartialEmoji | null;
336
+ guild_id: string;
337
+ user_id: string;
338
+ }
339
+
340
+ export interface VoiceChannelEffect {
341
+ animationID?: number;
342
+ animationType?: AnimationTypes;
343
+ }
344
+
345
+ export interface RawMessagePollVote {
346
+ answer_id: number;
347
+ channel_id: string;
348
+ guild_id?: string;
349
+ message_id: string;
350
+ user_id: string;
351
+ }
@@ -0,0 +1,33 @@
1
+ /** @module Types/GuildTemplate */
2
+ import type { RawGuild } from "./guilds";
3
+ import type { RawUser } from "./users";
4
+
5
+ export interface RawGuildTemplate {
6
+ code: string;
7
+ created_at: string;
8
+ creator: RawUser;
9
+ creator_id: string;
10
+ description: string | null;
11
+ is_dirty: boolean | null;
12
+ name: string;
13
+ serialized_source_guild: Partial<RawGuild>;
14
+ source_guild_id: string;
15
+ updated_at: string;
16
+ usage_count: number;
17
+ }
18
+
19
+ export interface CreateGuildFromTemplateOptions {
20
+ /** The icon for the created guild (buffer, or full data url). */
21
+ icon?: Buffer | string;
22
+ /** The name of the guild. */
23
+ name: string;
24
+ }
25
+
26
+ export interface CreateTemplateOptions {
27
+ /** The description of the template. */
28
+ description?: string | null;
29
+ /** The name of the template. */
30
+ name: string;
31
+ }
32
+
33
+ export interface EditGuildTemplateOptions extends Partial<CreateTemplateOptions> {}