@squord/sdk 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,726 @@
1
+ /**
2
+ * Tipos primitivos usados em toda a API do Squord.
3
+ *
4
+ * Convenções da plataforma (https://docs.squord.com.br/referencia/convencoes):
5
+ * - Todo id é uma **string** opaca (Snowflake decimal de até 20 dígitos, ou o
6
+ * formato antigo de 24 caracteres hexadecimais). Nunca converta para número.
7
+ * - Datas em ISO 8601, UTC.
8
+ * - Permissões trafegam como **string decimal** e devem ser calculadas com
9
+ * `BigInt` (veja {@link Permissions}).
10
+ */
11
+ /** Id opaco de qualquer entidade do Squord. Trate como string. */
12
+ type Snowflake = string;
13
+ /** Data no formato ISO 8601 em UTC, ex.: `"2026-10-05T14:30:00.000Z"`. */
14
+ type ISODate = string;
15
+ /** Conjunto de permissões como string decimal. Calcule com `BigInt`. */
16
+ type PermissionBits = string;
17
+ /** Cursor opaco de paginação gerado pela API. */
18
+ type Cursor = string;
19
+ /** Menções permitidas em uma mensagem. Seguras por padrão. */
20
+ interface AllowedMentions {
21
+ /** Menções de pessoas (`<@id>`) notificam. Padrão: `true`. */
22
+ users?: boolean;
23
+ /** Menções de cargos (`<@&id>`) notificam. Padrão: `false` (removidas do texto). */
24
+ roles?: boolean;
25
+ /** `@everyone` notifica. Padrão: `false` (vira texto simples). */
26
+ everyone?: boolean;
27
+ }
28
+ /** Formato de página devolvido pelas rotas paginadas por cursor. */
29
+ interface Page<T> {
30
+ /** Itens da página. */
31
+ items: T[];
32
+ /** Passe como `before` para a página anterior (mais antiga). `null` no início. */
33
+ prevCursor: Cursor | null;
34
+ /** Passe como `after` para a página seguinte (mais nova). `null` no fim. */
35
+ nextCursor: Cursor | null;
36
+ /** Se há mais itens na direção consultada. */
37
+ hasMore: boolean;
38
+ }
39
+ /** Parâmetros de listagem com paginação por cursor. */
40
+ interface CursorPaginationParams {
41
+ /** Tamanho da página (padrão e máximo dependem da rota). */
42
+ limit?: number;
43
+ /** Cursor da resposta anterior: devolve a página mais antiga. */
44
+ before?: Cursor;
45
+ /** Cursor da resposta anterior: devolve a página mais nova. */
46
+ after?: Cursor;
47
+ }
48
+ /** Chave de idempotência de mensagens: repetir o envio com o mesmo `nonce` devolve a mensagem original. */
49
+ type Nonce = string;
50
+
51
+ /**
52
+ * Tipos dos payloads reais da API REST do Squord (v1).
53
+ *
54
+ * Espelham o contrato publicado em https://docs.squord.com.br (OpenAPI).
55
+ * Todos os objetos trafegam em JSON UTF-8 com campos em `camelCase`.
56
+ */
57
+
58
+ /** Flags de uma conta, somadas em `flags`. */
59
+ declare const UserFlags: {
60
+ readonly STAFF: number;
61
+ readonly EARLY_SUPPORTER: number;
62
+ readonly VERIFIED_BOT: number;
63
+ readonly SYSTEM: number;
64
+ readonly VERIFIED: number;
65
+ readonly BOT: number;
66
+ };
67
+ /** Estilo de nome de usuário (Squord Plus). */
68
+ interface APIUserNameStyle {
69
+ font: string;
70
+ effect: string;
71
+ colors: string[];
72
+ }
73
+ /** Perfil público de uma conta, embutido em mensagens, membros e interações. */
74
+ interface APIUser {
75
+ id: Snowflake;
76
+ /** Handle único em minúsculas. O de um bot começa com `bot~`. */
77
+ username: string;
78
+ displayName: string;
79
+ avatarUrl: string | null;
80
+ /** Só preenchido enquanto o usuário tem Squord Plus. */
81
+ avatarAnimatedUrl: string | null;
82
+ nameStyle: APIUserNameStyle | null;
83
+ flags: number;
84
+ deleted: boolean;
85
+ suspended: boolean;
86
+ premium: boolean;
87
+ }
88
+ /** Visão da própria conta (`GET /users/@me`). Em um bot, quase tudo é padrão. */
89
+ interface APICurrentUser extends APIUser {
90
+ email: string | null;
91
+ [key: string]: unknown;
92
+ }
93
+ /** O bot na visão do dono (`GET /bots/@me`). */
94
+ interface APIBot {
95
+ id: Snowflake;
96
+ user: APIUser;
97
+ description: string | null;
98
+ ownerUsername: string;
99
+ public: boolean;
100
+ verified: boolean;
101
+ installCount: number;
102
+ termsUrl: string | null;
103
+ privacyUrl: string | null;
104
+ createdAt: ISODate;
105
+ /** Soma de bits das intents configuradas (veja {@link Intents}). */
106
+ intents?: number;
107
+ }
108
+ /** Flags de um Space, somadas em `flags`. */
109
+ declare const GuildFlags: {
110
+ readonly OFFICIAL: number;
111
+ readonly PARTNER: number;
112
+ readonly DISCOVERY_BLOCKED: number;
113
+ readonly VERIFIED: number;
114
+ readonly DISCOVERY_AGE_WAIVED: number;
115
+ };
116
+ /** Uma regra publicada do Space. */
117
+ interface APIGuildRule {
118
+ title: string;
119
+ description: string;
120
+ }
121
+ /** O bot (ou quem chama) dentro de um Space. */
122
+ interface APIGuildSelf {
123
+ memberId: Snowflake;
124
+ roleIds: Snowflake[];
125
+ /** Permissões no nível do Space (overwrites de canal ainda se aplicam). */
126
+ permissions: PermissionBits;
127
+ isOwner: boolean;
128
+ }
129
+ /** Um Space: comunidade com membros, cargos, canais e regras próprias. */
130
+ interface APIGuild {
131
+ id: Snowflake;
132
+ ownerId: Snowflake;
133
+ name: string;
134
+ slug: string;
135
+ description: string | null;
136
+ iconUrl: string | null;
137
+ iconAnimatedUrl: string | null;
138
+ bannerUrl: string | null;
139
+ bannerAnimatedUrl: string | null;
140
+ bannerPlaceholder: string | null;
141
+ defaultChannelId: Snowflake | null;
142
+ systemChannelId: Snowflake | null;
143
+ visibility: string;
144
+ verificationLevel: string;
145
+ accessMode: "INVITE_ONLY" | "LINK" | "REQUEST";
146
+ requireVerifiedEmail: boolean;
147
+ requireTwoFactor: boolean;
148
+ moderationMfaRequired: boolean;
149
+ joinRequestRoleIds: Snowflake[];
150
+ requireJoinMessage: boolean;
151
+ joinRequestRetryDays: number;
152
+ /** Quantas pessoas são membros (não conta bots nem webhooks). */
153
+ memberCount: number;
154
+ flags: number;
155
+ planId: string;
156
+ vanityLapsesAt: ISODate | null;
157
+ vanityInvite: boolean;
158
+ boostCount: number;
159
+ boostLevel: number;
160
+ boostMessages: boolean;
161
+ discoveryCategory: string | null;
162
+ locale: string | null;
163
+ rules: APIGuildRule[];
164
+ rulesUpdatedAt: ISODate | null;
165
+ discoverable: boolean;
166
+ discoverableSince: ISODate | null;
167
+ minAccountAgeDays: number;
168
+ createdAt: ISODate;
169
+ updatedAt: ISODate;
170
+ self: APIGuildSelf;
171
+ }
172
+ type ChannelType = "TEXT" | "ANNOUNCEMENT" | "CATEGORY" | "FORUM" | "VOICE" | "STAGE" | "THREAD";
173
+ /** Exceção de permissão de um cargo ou membro em um canal. */
174
+ interface APIChannelOverwrite {
175
+ targetId: Snowflake;
176
+ targetType: "ROLE" | "MEMBER";
177
+ allow: PermissionBits;
178
+ deny: PermissionBits;
179
+ }
180
+ /** Tag de um canal de fórum. */
181
+ interface APIForumTag {
182
+ id: Snowflake;
183
+ name: string;
184
+ emoji: string | null;
185
+ moderated: boolean;
186
+ }
187
+ /** Um canal do Space (threads têm o formato próprio {@link APIThread}). */
188
+ interface APIChannel {
189
+ id: Snowflake;
190
+ guildId: Snowflake;
191
+ categoryId: Snowflake | null;
192
+ name: string;
193
+ type: ChannelType;
194
+ position: number;
195
+ topic: string | null;
196
+ topicUpdatedAt: ISODate | null;
197
+ topicUpdatedById: Snowflake | null;
198
+ isPrivate: boolean;
199
+ /** Modo lento: segundos entre mensagens. `0` desliga. */
200
+ rateLimitPerUser: number;
201
+ bitrate: number | null;
202
+ userLimit: number | null;
203
+ chatEnabled: boolean;
204
+ lastMessageId: Snowflake | null;
205
+ overwrites: APIChannelOverwrite[];
206
+ availableTags: APIForumTag[];
207
+ requireTag: boolean;
208
+ defaultAutoArchiveMinutes: number | null;
209
+ createdAt: ISODate;
210
+ updatedAt: ISODate;
211
+ }
212
+ /** Um grupo da árvore de canais de um Space. */
213
+ interface APIChannelTreeNode {
214
+ category: APIChannel | null;
215
+ channels: APIChannel[];
216
+ }
217
+ type ThreadAutoArchiveMinutes = 60 | 1440 | 4320 | 10080;
218
+ /** A primeira mensagem de um post de fórum, como o card mostra. */
219
+ interface APIThreadPostPreview {
220
+ messageId: Snowflake;
221
+ author: APIUser;
222
+ content: string;
223
+ hasAttachment: boolean;
224
+ hasImage: boolean;
225
+ hasSticker: boolean;
226
+ deleted: boolean;
227
+ moderated: boolean;
228
+ }
229
+ /** Uma thread ou post de fórum. Use o `id` como `channelId` nas rotas de mensagem. */
230
+ interface APIThread {
231
+ id: Snowflake;
232
+ guildId: Snowflake;
233
+ type: "THREAD";
234
+ /** Canal de texto, de anúncios ou fórum de onde ela parte. */
235
+ parentId: Snowflake;
236
+ name: string;
237
+ ownerId: Snowflake;
238
+ starterMessageId: Snowflake | null;
239
+ isForumPost: boolean;
240
+ archived: boolean;
241
+ archivedAt: ISODate | null;
242
+ locked: boolean;
243
+ autoArchiveMinutes: ThreadAutoArchiveMinutes;
244
+ rateLimitPerUser: number;
245
+ messageCount: number;
246
+ lastMessageId: Snowflake | null;
247
+ lastMessageAt: ISODate;
248
+ appliedTagIds: Snowflake[];
249
+ postPreview: APIThreadPostPreview | null;
250
+ createdAt: ISODate;
251
+ updatedAt: ISODate;
252
+ }
253
+ interface APIThreadPage extends Page<APIThread> {
254
+ }
255
+ /** Corpo de criar thread em canal de texto/anúncios ou a partir de uma mensagem. */
256
+ interface APIThreadCreateBody {
257
+ name: string;
258
+ autoArchiveMinutes?: ThreadAutoArchiveMinutes;
259
+ rateLimitPerUser?: number;
260
+ }
261
+ /** Corpo de criar um post em fórum. */
262
+ interface APIForumPostCreateBody {
263
+ name: string;
264
+ /** A primeira mensagem: corpo de criar mensagem, sem `replyToId`. */
265
+ message: APIMessageCreateBody;
266
+ appliedTagIds?: Snowflake[];
267
+ autoArchiveMinutes?: ThreadAutoArchiveMinutes;
268
+ }
269
+ interface APIThreadListParams extends CursorPaginationParams {
270
+ /** `true` lista as arquivadas; `false` (padrão), as ativas. */
271
+ archived?: "true" | "false";
272
+ /** Só em fórum: posts com esta tag. */
273
+ tagId?: Snowflake;
274
+ }
275
+ type RoleManagedKind = "BOOSTER" | "BOT";
276
+ /** Um cargo agrupa permissões e uma aparência. Hierárquico por `position`. */
277
+ interface APIRole {
278
+ id: Snowflake;
279
+ guildId: Snowflake;
280
+ name: string;
281
+ color: string | null;
282
+ position: number;
283
+ permissions: PermissionBits;
284
+ hoist: boolean;
285
+ mentionable: boolean;
286
+ managed: boolean;
287
+ managedKind: RoleManagedKind | null;
288
+ botId: Snowflake | null;
289
+ icon: string | null;
290
+ selfAssignable: boolean;
291
+ createdAt: ISODate;
292
+ updatedAt: ISODate;
293
+ }
294
+ type MemberType = "INTERNAL" | "BOT" | "WEBHOOK";
295
+ interface APIMemberNameStyle {
296
+ font: string;
297
+ effect: string;
298
+ colors: string[];
299
+ }
300
+ /** Perfil de um usuário dentro de um Space, com o `user` embutido. */
301
+ interface APIMember {
302
+ id: Snowflake;
303
+ guildId: Snowflake;
304
+ userId: Snowflake;
305
+ user: APIUser;
306
+ type: MemberType;
307
+ nickname: string | null;
308
+ avatarUrl: string | null;
309
+ avatarAnimatedUrl: string | null;
310
+ bannerUrl: string | null;
311
+ bannerAnimatedUrl: string | null;
312
+ bio: string | null;
313
+ bioEmojis: Array<{
314
+ id: Snowflake;
315
+ name: string;
316
+ animated: boolean;
317
+ url: string;
318
+ }>;
319
+ nameStyle: APIMemberNameStyle | null;
320
+ profileFont: string | null;
321
+ profileTheme: string[] | null;
322
+ roleIds: Snowflake[];
323
+ joinedAt: ISODate;
324
+ timeoutUntil: ISODate | null;
325
+ deaf: boolean;
326
+ mute: boolean;
327
+ pending: boolean;
328
+ boostingSince: ISODate | null;
329
+ createdAt: ISODate;
330
+ updatedAt: ISODate;
331
+ }
332
+ interface APIMemberPage extends Page<APIMember> {
333
+ }
334
+ /** Corpo de `PATCH /guilds/{guildId}/members/{userId}` (todos os campos opcionais). */
335
+ interface APIMemberEditBody {
336
+ /** `null` limpa o apelido. */
337
+ nickname?: string | null;
338
+ /** **Substitui** o conjunto de cargos. */
339
+ roleIds?: Snowflake[];
340
+ /** Data futura aplica timeout; `null` retira. */
341
+ timeoutUntil?: ISODate | null;
342
+ deaf?: boolean;
343
+ mute?: boolean;
344
+ }
345
+ interface APIMemberBanBody {
346
+ reason?: string | null;
347
+ /** Quanto do histórico recente apagar, em segundos (até 7 dias). */
348
+ deleteMessageSeconds?: number;
349
+ }
350
+ /** Um banimento. */
351
+ interface APIMemberBan {
352
+ id: Snowflake;
353
+ guildId: Snowflake;
354
+ userId: Snowflake;
355
+ moderatorId: Snowflake;
356
+ byPlatform: boolean;
357
+ reason: string | null;
358
+ createdAt: ISODate;
359
+ }
360
+ type MessageType = "DEFAULT" | "REPLY" | "POLL" | "SYSTEM_MEMBER_JOIN" | "SYSTEM_MEMBER_LEAVE" | "SYSTEM_CHANNEL_PINNED" | "SYSTEM_CALL_STARTED" | "SYSTEM_GROUP_CREATED" | "SYSTEM_MEMBER_ADDED" | "SYSTEM_MEMBER_REMOVED" | "SYSTEM_GROUP_LEFT" | "SYSTEM_CHANNEL_FOLLOWED" | "SYSTEM_GUILD_BOOST" | "SYSTEM_THREAD_CREATED" | "SYSTEM_AUTOMOD_ALERT";
361
+ type AttachmentScanStatus = "NOT_REQUIRED" | "PENDING" | "CLEAN" | "INFECTED" | "FAILED" | "EXPLICIT";
362
+ /** Arquivo anexado a uma mensagem. Para enviar, veja {@link APIUpload}. */
363
+ interface APIAttachment {
364
+ id: Snowflake;
365
+ kind: string;
366
+ source: "UPLOAD" | "KLIPY";
367
+ providerId: string | null;
368
+ filename: string;
369
+ contentType: string;
370
+ size: number;
371
+ url: string;
372
+ thumbnailUrl: string | null;
373
+ width: number | null;
374
+ height: number | null;
375
+ durationMs: number | null;
376
+ placeholder: string | null;
377
+ scanStatus: AttachmentScanStatus;
378
+ }
379
+ /** Embed como é **lido**. O que se envia usa {@link APIEmbedInput}. */
380
+ interface APIEmbed {
381
+ type: "RICH" | "LINK" | "IMAGE" | "VIDEO";
382
+ url: string | null;
383
+ title: string | null;
384
+ description: string | null;
385
+ siteName: string | null;
386
+ thumbnailUrl: string | null;
387
+ color: string | null;
388
+ author: {
389
+ name: string;
390
+ url?: string | null;
391
+ iconUrl?: string | null;
392
+ } | null;
393
+ fields: Array<{
394
+ name: string;
395
+ value: string;
396
+ inline?: boolean;
397
+ }>;
398
+ image: {
399
+ url: string;
400
+ } | null;
401
+ footer: {
402
+ text: string;
403
+ iconUrl?: string | null;
404
+ } | null;
405
+ timestamp: ISODate | null;
406
+ video: {
407
+ url: string;
408
+ } | null;
409
+ }
410
+ /** Embed que se **envia** (formato aceito pelo Squord). */
411
+ interface APIEmbedInput {
412
+ title?: string | null;
413
+ description?: string | null;
414
+ /** Só `http://` ou `https://`. */
415
+ url?: string | null;
416
+ /** Inteiro de 0 a 16777215, ou `#rrggbb`. */
417
+ color?: number | string | null;
418
+ /** ISO 8601 com fuso. */
419
+ timestamp?: string | null;
420
+ author?: {
421
+ name: string;
422
+ url?: string | null; /** snake_case na API. */
423
+ icon_url?: string | null;
424
+ } | null;
425
+ footer?: {
426
+ text: string;
427
+ icon_url?: string | null;
428
+ } | null;
429
+ image?: {
430
+ url: string;
431
+ } | null;
432
+ thumbnail?: {
433
+ url: string;
434
+ } | null;
435
+ fields?: Array<{
436
+ name: string;
437
+ value: string;
438
+ inline?: boolean;
439
+ }>;
440
+ }
441
+ interface APIReaction {
442
+ /** Emoji Unicode, ou `<:nome:id>` / `<a:nome:id>` para um personalizado. */
443
+ emoji: string;
444
+ count: number;
445
+ userIds: Snowflake[];
446
+ me: boolean;
447
+ }
448
+ interface APIMessageEmoji {
449
+ id: Snowflake;
450
+ name: string;
451
+ animated: boolean;
452
+ url: string;
453
+ }
454
+ interface APIMessageMentions {
455
+ userIds: Snowflake[];
456
+ roleIds: Snowflake[];
457
+ channelIds: Snowflake[];
458
+ everyone: boolean;
459
+ }
460
+ interface APIMessageInteractionMeta {
461
+ id: Snowflake;
462
+ type: string;
463
+ name: string | null;
464
+ userId: Snowflake;
465
+ }
466
+ interface APIStickerItem {
467
+ id: Snowflake;
468
+ guildId: Snowflake;
469
+ name: string;
470
+ format: string;
471
+ url: string;
472
+ }
473
+ /** A mensagem citada em uma resposta. */
474
+ interface APIMessageReplyTo {
475
+ id: Snowflake;
476
+ authorId: Snowflake;
477
+ author: APIUser;
478
+ content: string;
479
+ deleted: boolean;
480
+ moderated: boolean;
481
+ preview?: Record<string, unknown>;
482
+ }
483
+ /** Uma mensagem com o autor. */
484
+ interface APIMessage {
485
+ id: Snowflake;
486
+ /** `null` em mensagem direta (bots não acessam DMs). */
487
+ guildId: Snowflake | null;
488
+ channelId: Snowflake;
489
+ authorId: Snowflake;
490
+ type: MessageType;
491
+ content: string;
492
+ replyToId: Snowflake | null;
493
+ attachments: APIAttachment[];
494
+ embeds: APIEmbed[];
495
+ components: APIComponentRow[];
496
+ interaction: APIMessageInteractionMeta | null;
497
+ mentions: APIMessageMentions;
498
+ reactions: APIReaction[];
499
+ pinned: boolean;
500
+ editedAt: ISODate | null;
501
+ deletedAt: ISODate | null;
502
+ moderated: boolean;
503
+ nonce: Nonce | null;
504
+ call: Record<string, unknown> | null;
505
+ poll: Record<string, unknown> | null;
506
+ forward: Record<string, unknown> | null;
507
+ relay: Record<string, unknown> | null;
508
+ relayedCount: number | null;
509
+ stickers: APIStickerItem[];
510
+ emojis: APIMessageEmoji[];
511
+ thread: Record<string, unknown> | null;
512
+ automod: Record<string, unknown> | null;
513
+ createdAt: ISODate;
514
+ updatedAt: ISODate;
515
+ author: APIUser;
516
+ memberNickname: string | null;
517
+ memberAvatarUrl: string | null;
518
+ memberNameStyle: APIMemberNameStyle | null;
519
+ replyTo: APIMessageReplyTo | null;
520
+ }
521
+ interface APIMessagePage extends Page<APIMessage> {
522
+ }
523
+ /** Corpo de criar mensagem. Ao menos um entre `content`, `embeds`, `components` e `attachmentIds`. */
524
+ interface APIMessageCreateBody {
525
+ content?: string;
526
+ embeds?: APIEmbedInput[];
527
+ components?: APIComponentRow[];
528
+ allowedMentions?: AllowedMentions;
529
+ replyToId?: Snowflake | null;
530
+ attachmentIds?: Snowflake[];
531
+ /** Chave de idempotência (até 64 caracteres): repetir devolve a original. */
532
+ nonce?: Nonce | null;
533
+ }
534
+ /** Corpo de editar mensagem. `embeds`/`components` substituem a lista inteira. */
535
+ interface APIMessageEditBody {
536
+ content?: string;
537
+ embeds?: APIEmbedInput[];
538
+ components?: APIComponentRow[];
539
+ allowedMentions?: AllowedMentions;
540
+ }
541
+ interface APIMessageListParams extends CursorPaginationParams {
542
+ }
543
+ type ButtonStyle = "primary" | "secondary" | "danger" | "link";
544
+ interface APIButton {
545
+ type: "button";
546
+ style: ButtonStyle;
547
+ label: string;
548
+ customId?: string;
549
+ url?: string;
550
+ disabled?: boolean;
551
+ }
552
+ interface APISelectOption {
553
+ label: string;
554
+ value: string;
555
+ description?: string;
556
+ }
557
+ interface APISelectMenu {
558
+ type: "select";
559
+ customId: string;
560
+ placeholder?: string;
561
+ minValues?: number;
562
+ maxValues?: number;
563
+ disabled?: boolean;
564
+ options: APISelectOption[];
565
+ }
566
+ /** Uma linha de componentes: 1 a 5 botões **ou** exatamente 1 menu. */
567
+ interface APIComponentRow {
568
+ type: "row";
569
+ components: Array<APIButton | APISelectMenu>;
570
+ }
571
+ type CommandOptionType = "STRING" | "INTEGER" | "BOOLEAN" | "USER" | "CHANNEL" | "ROLE";
572
+ interface APICommandOptionChoice {
573
+ name: string;
574
+ value: string | number;
575
+ }
576
+ /** Uma opção na **definição** de um comando. */
577
+ interface APICommandOptionInput {
578
+ type: CommandOptionType;
579
+ /** Letras minúsculas, números, `_` e `-` (até 32 caracteres). */
580
+ name: string;
581
+ description: string;
582
+ required?: boolean;
583
+ choices?: APICommandOptionChoice[];
584
+ }
585
+ /** Uma opção no objeto comando devolvido pela API. */
586
+ interface APICommandOption extends APICommandOptionInput {
587
+ required: boolean;
588
+ }
589
+ /** Um comando de barra registrado por um bot. */
590
+ interface APICommand {
591
+ id: Snowflake;
592
+ botId: Snowflake;
593
+ guildId: Snowflake | null;
594
+ name: string;
595
+ description: string;
596
+ options: APICommandOption[];
597
+ updatedAt: ISODate;
598
+ }
599
+ /** Um comando no corpo do `PUT` em bloco. */
600
+ interface APICommandInput {
601
+ name: string;
602
+ description: string;
603
+ options?: APICommandOptionInput[];
604
+ }
605
+ type InteractionType = "COMMAND" | "COMPONENT";
606
+ type InteractionCallbackType = "MESSAGE" | "DEFERRED" | "UPDATE" | "DEFERRED_UPDATE";
607
+ /** Dados de um comando invocado: as opções já validadas pelo Squord. */
608
+ interface APIInteractionCommandData {
609
+ id: Snowflake;
610
+ name: string;
611
+ options: Array<{
612
+ name: string;
613
+ type: CommandOptionType;
614
+ value: string | number | boolean;
615
+ }>;
616
+ }
617
+ /** Dados de um clique/uso de componente. */
618
+ interface APIInteractionComponentData {
619
+ messageId: Snowflake;
620
+ customId: string;
621
+ type: "button" | "select";
622
+ /** Valores escolhidos em um menu; vazio em um botão. */
623
+ values: string[];
624
+ }
625
+ /** O `d` do evento `interaction.created`. Nenhuma rota REST devolve este objeto. */
626
+ interface APIInteraction {
627
+ id: Snowflake;
628
+ /** Credencial da interação, válida por 15 minutos. Trate como segredo. */
629
+ token: string;
630
+ type: InteractionType;
631
+ guildId: Snowflake;
632
+ channelId: Snowflake;
633
+ user: APIUser;
634
+ member: APIMember | null;
635
+ command?: APIInteractionCommandData;
636
+ component?: APIInteractionComponentData;
637
+ createdAt: ISODate;
638
+ }
639
+ /** Dados da resposta de uma interação ou follow-up. */
640
+ interface APIInteractionReplyData {
641
+ content?: string;
642
+ embeds?: APIEmbedInput[];
643
+ components?: APIComponentRow[];
644
+ allowedMentions?: AllowedMentions;
645
+ /** Só a pessoa que invocou vê. Não é salva; só aceita botões de link. */
646
+ ephemeral?: boolean;
647
+ }
648
+ interface APIInteractionCallbackBody {
649
+ type: InteractionCallbackType;
650
+ data?: APIInteractionReplyData;
651
+ }
652
+ /** Estado de um upload. */
653
+ type UploadStatus = "PENDING" | "READY" | "ATTACHED";
654
+ /** Um upload reservado/confirmado. */
655
+ interface APIUpload {
656
+ id: Snowflake;
657
+ scope: string;
658
+ filename: string;
659
+ contentType: string;
660
+ size: number;
661
+ status: UploadStatus;
662
+ url: string | null;
663
+ thumbnailUrl: string | null;
664
+ guildId: Snowflake | null;
665
+ storageKey: string;
666
+ scanStatus: AttachmentScanStatus;
667
+ animated: boolean;
668
+ animatedUrl: string | null;
669
+ createdAt: ISODate;
670
+ expiresAt: ISODate;
671
+ }
672
+ /** Alvo do `PUT` dos bytes, devolvido só na reserva. */
673
+ interface APIUploadTarget {
674
+ uploadUrl: string;
675
+ method: "PUT";
676
+ /** Cabeçalhos que o `PUT` precisa repetir exatamente. */
677
+ headers: Record<string, string>;
678
+ storageKey: string;
679
+ publicUrl: string;
680
+ expiresAt: ISODate;
681
+ }
682
+ interface APIUploadReservation {
683
+ upload: APIUpload;
684
+ target: APIUploadTarget;
685
+ }
686
+ interface APIUploadCreateBody {
687
+ /** Para bots, sempre `attachments`. */
688
+ scope: string;
689
+ filename: string;
690
+ contentType: string;
691
+ size: number;
692
+ guildId: Snowflake | null;
693
+ }
694
+ /** Corpo da confirmação de upload. Pode ser `{}`. */
695
+ interface APIUploadConfirmBody {
696
+ crop?: {
697
+ left: number;
698
+ top: number;
699
+ width: number;
700
+ height: number;
701
+ } | null;
702
+ placeholder?: string | null;
703
+ }
704
+ /** Envelope de todo erro da API. Decida pelo `code`, nunca pela `message`. */
705
+ interface APIErrorBody {
706
+ statusCode: number;
707
+ code: string;
708
+ message: string;
709
+ details?: unknown;
710
+ requestId?: string;
711
+ }
712
+ /** Item de validação de um `422 VALIDATION_FAILED`. */
713
+ interface APIValidationIssue {
714
+ path: string;
715
+ code: string;
716
+ message: string;
717
+ params?: Record<string, unknown>;
718
+ }
719
+ /** Menção de pessoa: `<@ID>`. */
720
+ declare function userMention(id: Snowflake): string;
721
+ /** Menção de cargo: `<@&ID>`. */
722
+ declare function roleMention(id: Snowflake): string;
723
+ /** Menção de canal: `<#ID>`. */
724
+ declare function channelMention(id: Snowflake): string;
725
+
726
+ export { type APIValidationIssue as $, type APIButton as A, type ButtonStyle as B, type CursorPaginationParams as C, type APIMemberBan as D, type APIMessage as E, type APIMessageListParams as F, type APIMessagePage as G, type APIReaction as H, type ISODate as I, type APIUploadCreateBody as J, type APIUploadReservation as K, type APIUploadConfirmBody as L, type APIUpload as M, type APIUser as N, type MessageType as O, type ChannelType as P, type APIInteraction as Q, type APIInteractionCommandData as R, type Snowflake as S, type ThreadAutoArchiveMinutes as T, type APIInteractionComponentData as U, type CommandOptionType as V, type PermissionBits as W, type APIChannelOverwrite as X, type APICommandOptionInput as Y, type Page as Z, type APIErrorBody as _, type APISelectOption as a, type APIAttachment as a0, type APICommandOption as a1, type APICommandOptionChoice as a2, type APIForumTag as a3, type APIGuildRule as a4, type APIGuildSelf as a5, type APIMessageEditBody as a6, type APIMessageReplyTo as a7, type APIUploadTarget as a8, type AttachmentScanStatus as a9, type Cursor as aa, GuildFlags as ab, type InteractionCallbackType as ac, type InteractionType as ad, type MemberType as ae, type Nonce as af, type RoleManagedKind as ag, type UploadStatus as ah, UserFlags as ai, channelMention as aj, roleMention as ak, userMention as al, type APISelectMenu as b, type APIComponentRow as c, type APIEmbedInput as d, type APIEmbed as e, type AllowedMentions as f, type APIMessageCreateBody as g, type APICommand as h, type APICommandInput as i, type APIBot as j, type APICurrentUser as k, type APIChannel as l, type APIChannelTreeNode as m, type APIThreadCreateBody as n, type APIThread as o, type APIForumPostCreateBody as p, type APIThreadListParams as q, type APIThreadPage as r, type APIInteractionCallbackBody as s, type APIInteractionReplyData as t, type APIGuild as u, type APIMember as v, type APIMemberPage as w, type APIMemberEditBody as x, type APIRole as y, type APIMemberBanBody as z };