-
-
Notifications
You must be signed in to change notification settings - Fork 117
/
channel.ts
1315 lines (1255 loc) · 35.1 KB
/
channel.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Types extracted from https://discord.com/developers/docs/resources/channel
*/
import type { APIApplication } from './application.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIMessageInteraction } from './interactions.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker, APIStickerItem } from './sticker.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';
/**
* Not documented, but partial only includes id, name, and type
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIPartialChannel {
/**
* The id of the channel
*/
id: Snowflake;
/**
* The type of the channel
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*/
type: ChannelType;
/**
* The name of the channel (2-100 characters)
*/
name?: string;
}
/**
* This interface is used to allow easy extension for other channel types. While
* also allowing `APIPartialChannel` to be used without breaking.
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel {
type: T;
}
// TODO: update when text in voice is released
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type TextChannelType = ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildNews | ChannelType.GuildText;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GuildChannelType = Exclude<
| TextChannelType
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice
| ChannelType.GuildNews
| ChannelType.GuildStore,
ChannelType.DM | ChannelType.GroupDM
>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* The id of the guild (may be missing for some channel objects received over gateway guild dispatches)
*/
guild_id?: Snowflake;
/**
* Explicit permission overwrites for members and roles
*
* See https://discord.com/developers/docs/resources/channel#overwrite-object
*/
permission_overwrites?: APIOverwrite[];
/**
* Sorting position of the channel
*/
position?: number;
/**
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
*/
parent_id?: Snowflake | null;
/**
* Whether the channel is nsfw
*/
nsfw?: boolean;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIGuildTextChannel<T extends GuildTextChannelType>
extends APITextBasedChannel<T>,
APIGuildChannel<T> {
/**
* The channel topic (0-1024 characters)
*/
topic?: string | null;
/**
* When the last pinned message was pinned.
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
*/
last_pin_timestamp?: string | null;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APITextChannel extends APIGuildTextChannel<ChannelType.GuildText> {
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*/
rate_limit_per_user?: number;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIGuildStoreChannel = APIGuildChannel<ChannelType.GuildStore>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageVoice | ChannelType.GuildVoice> {
/**
* The bitrate (in bits) of the voice channel
*/
bitrate?: number;
/**
* The user limit of the voice channel
*/
user_limit?: number;
/**
* Voice region id for the voice or stage channel, automatic when set to `null`
*
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
rtc_region?: string | null;
/**
* The camera video quality mode of the voice channel, `1` when not present
*
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
*/
video_quality_mode?: VideoQualityMode;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T> {
/**
* The recipients of the DM
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
recipients?: APIUser[];
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIDMChannel = APIDMChannelBase<ChannelType.DM>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
/**
* Application id of the group DM creator if it is bot-created
*/
application_id?: Snowflake;
/**
* Icon hash
*/
icon?: string | null;
/**
* ID of the DM creator
*/
owner_id?: Snowflake;
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIChannel =
| APIGroupDMChannel
| APIDMChannel
| APITextChannel
| APINewsChannel
| APIGuildStoreChannel
| APIVoiceChannel
| APIGuildCategoryChannel
| APINewsChannel;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum ChannelType {
/**
* A text channel within a guild
*/
GuildText,
/**
* A direct message between users
*/
DM,
/**
* A voice channel within a guild
*/
GuildVoice,
/**
* A direct message between multiple users
*/
GroupDM,
/**
* An organizational category that contains up to 50 channels
*
* See https://support.discord.com/hc/en-us/articles/115001580171-Channel-Categories-101
*/
GuildCategory,
/**
* A channel that users can follow and crosspost into their own guild
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews,
/**
* A channel in which game developers can sell their game on Discord
*
* See https://discord.com/developers/docs/game-and-server-management/special-channels
*/
GuildStore,
/**
* A voice channel for hosting events with an audience
*
* See https://support.discord.com/hc/en-us/articles/1500005513722
*/
GuildStageVoice = 13,
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum VideoQualityMode {
/**
* Discord chooses the quality for optimal performance
*/
Auto = 1,
/**
* 720p
*/
Full,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIMessage {
/**
* ID of the message
*/
id: Snowflake;
/**
* ID of the channel the message was sent in
*/
channel_id: Snowflake;
/**
* ID of the guild the message was sent in
*/
guild_id?: Snowflake;
/**
* The author of this message (only a valid user in the case where the message is generated by a user or bot user)
*
* If the message is generated by a webhook, the author object corresponds to the webhook's id,
* username, and avatar. You can tell if a message is generated by a webhook by checking for the `webhook_id` property
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
author: APIUser;
/**
* Member properties for this message's author
*
* The member object exists in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* See https://discord.com/developers/docs/resources/guild#guild-member-object
*/
member?: APIGuildMember;
/**
* Contents of the message
*/
content: string;
/**
* When this message was sent
*/
timestamp: string;
/**
* When this message was edited (or null if never)
*/
edited_timestamp: string | null;
/**
* Whether this was a TTS message
*/
tts: boolean;
/**
* Whether this message mentions everyone
*/
mention_everyone: boolean;
/**
* Users specifically mentioned in the message
*
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* See https://discord.com/developers/docs/resources/user#user-object
* See https://discord.com/developers/docs/resources/guild#guild-member-object
*/
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
/**
* Roles specifically mentioned in this message
*
* See https://discord.com/developers/docs/topics/permissions#role-object
*/
mention_roles: APIRole['id'][];
/**
* Channels specifically mentioned in this message
*
* Not all channel mentions in a message will appear in `mention_channels`.
* - Only textual channels that are visible to everyone in a lurkable guild will ever be included
* - Only crossposted messages (via Channel Following) currently include `mention_channels` at all
*
* If no mentions in the message meet these requirements, this field will not be sent
*
* See https://discord.com/developers/docs/resources/channel#channel-mention-object
*/
mention_channels?: APIChannelMention[];
/**
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments: APIAttachment[];
/**
* Any embedded content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*/
embeds: APIEmbed[];
/**
* Reactions to the message
*
* See https://discord.com/developers/docs/resources/channel#reaction-object
*/
reactions?: APIReaction[];
/**
* A nonce that can be used for optimistic message sending (up to 25 characters)
*
* **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE`
* event to ensure it got sent**
*/
nonce?: string | number;
/**
* Whether this message is pinned
*/
pinned: boolean;
/**
* If the message is generated by a webhook, this is the webhook's id
*/
webhook_id?: Snowflake;
/**
* Type of message
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-types
*/
type: MessageType;
/**
* Sent with Rich Presence-related chat embeds
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
*/
activity?: APIMessageActivity;
/**
* Sent with Rich Presence-related chat embeds
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
*/
application?: Partial<APIApplication>;
/**
* If the message is a response to an Interaction, this is the id of the interaction's application
*/
application_id?: Snowflake;
/**
* Reference data sent with crossposted messages, replies, pins, and thread starter messages
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
*/
message_reference?: APIMessageReference;
/**
* Message flags combined as a bitfield
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-flags
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
flags?: MessageFlags;
/**
* The message associated with the `message_reference`
*
* This field is only returned for messages with a `type` of `19` (REPLY).
*
* If the message is a reply but the `referenced_message` field is not present,
* the backend did not attempt to fetch the message that was being replied to,
* so its state is unknown.
*
* If the field exists but is `null`, the referenced message was deleted
*
* See https://discord.com/developers/docs/resources/channel#message-object
*/
referenced_message?: APIMessage | null;
/**
* Sent if the message is a response to an Interaction
*/
interaction?: APIMessageInteraction;
/**
* Sent if the message contains components like buttons, action rows, or other interactive components
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
/**
* Sent if the message contains stickers
*
* See https://discord.com/developers/docs/resources/sticker#sticker-item-object
*/
sticker_items?: APIStickerItem[];
/**
* The stickers sent with the message
*
* See https://discord.com/developers/docs/resources/sticker#sticker-object
* @deprecated Use `sticker_items` instead
*/
stickers?: APISticker[];
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-types
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum MessageType {
Default,
RecipientAdd,
RecipientRemove,
Call,
ChannelNameChange,
ChannelIconChange,
ChannelPinnedMessage,
GuildMemberJoin,
UserPremiumGuildSubscription,
UserPremiumGuildSubscriptionTier1,
UserPremiumGuildSubscriptionTier2,
UserPremiumGuildSubscriptionTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified = 14,
GuildDiscoveryRequalified,
GuildDiscoveryGracePeriodInitialWarning,
GuildDiscoveryGracePeriodFinalWarning,
Reply = 19,
ChatInputCommand,
GuildInviteReminder = 22,
ContextMenuCommand,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIMessageActivity {
/**
* Type of message activity
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
*/
type: MessageActivityType;
/**
* `party_id` from a Rich Presence event
*
* See https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields
*/
party_id?: string;
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIMessageReference {
/**
* ID of the originating message
*/
message_id?: Snowflake;
/**
* ID of the originating message's channel
*/
channel_id: Snowflake;
/**
* ID of the originating message's guild
*/
guild_id?: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum MessageActivityType {
Join = 1,
Spectate,
Listen,
JoinRequest = 5,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum MessageFlags {
/**
* This message has been published to subscribed channels (via Channel Following)
*/
Crossposted = 1 << 0,
/**
* This message originated from a message in another channel (via Channel Following)
*/
IsCrosspost = 1 << 1,
/**
* Do not include any embeds when serializing this message
*/
SuppressEmbeds = 1 << 2,
/**
* The source message for this crosspost has been deleted (via Channel Following)
*/
SourceMessageDeleted = 1 << 3,
/**
* This message came from the urgent message system
*/
Urgent = 1 << 4,
/**
* This message is only visible to the user who invoked the Interaction
*/
Ephemeral = 1 << 6,
/**
* This message is an Interaction Response and the bot is "thinking"
*/
Loading = 1 << 7,
}
/**
* https://discord.com/developers/docs/resources/channel#followed-channel-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIFollowedChannel {
/**
* Source channel id
*/
channel_id: Snowflake;
/**
* Created target webhook id
*/
webhook_id: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIReaction {
/**
* Times this emoji has been used to react
*/
count: number;
/**
* Whether the current user reacted using this emoji
*/
me: boolean;
/**
* Emoji information
*
* See https://discord.com/developers/docs/resources/emoji#emoji-object
*/
emoji: APIPartialEmoji;
}
/**
* https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIOverwrite {
/**
* Role or user id
*/
id: Snowflake;
/**
* Either 0 (role) or 1 (member)
*
* {@link OverwriteType}
*/
type: OverwriteType;
/**
* Permission bit set
*
* See https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
allow: Permissions;
/**
* Permission bit set
*
* See https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
deny: Permissions;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum OverwriteType {
Role,
Member,
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-structure
*
* Length limit: 6000 characters
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIEmbed {
/**
* Title of embed
*
* Length limit: 256 characters
*/
title?: string;
/**
* Type of embed (always "rich" for webhook embeds)
*
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-types
*/
type?: EmbedType;
/**
* Description of embed
*
* Length limit: 4096 characters
*/
description?: string;
/**
* URL of embed
*/
url?: string;
/**
* Timestamp of embed content
*/
timestamp?: string;
/**
* Color code of the embed
*/
color?: number;
/**
* Footer information
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
*/
footer?: APIEmbedFooter;
/**
* Image information
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
*/
image?: APIEmbedImage;
/**
* Thumbnail information
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
*/
thumbnail?: APIEmbedThumbnail;
/**
* Video information
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
*/
video?: APIEmbedVideo;
/**
* Provider information
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
*/
provider?: APIEmbedProvider;
/**
* Author information
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
*/
author?: APIEmbedAuthor;
/**
* Fields information
*
* Length limit: 25 field objects
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
*/
fields?: APIEmbedField[];
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-types
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum EmbedType {
/**
* Generic embed rendered from embed attributes
*/
Rich = 'rich',
/**
* Image embed
*/
Image = 'image',
/**
* Video embed
*/
Video = 'video',
/**
* Animated gif image embed rendered as a video embed
*/
GIFV = 'gifv',
/**
* Article embed
*/
Article = 'article',
/**
* Link embed
*/
Link = 'link',
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIEmbedThumbnail {
/**
* Source url of thumbnail (only supports http(s) and attachments)
*/
url: string;
/**
* A proxied url of the thumbnail
*/
proxy_url?: string;
/**
* Height of thumbnail
*/
height?: number;
/**
* Width of thumbnail
*/
width?: number;
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIEmbedVideo {
/**
* Source url of video
*/
url?: string;
/**
* Height of video
*/
height?: number;
/**
* Width of video
*/
width?: number;
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIEmbedImage {
/**
* Source url of image (only supports http(s) and attachments)
*/
url: string;
/**
* A proxied url of the image
*/
proxy_url?: string;
/**
* Height of image
*/
height?: number;
/**
* Width of image
*/
width?: number;
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIEmbedProvider {
/**
* Name of provider
*/
name?: string;
/**
* URL of provider
*/
url?: string;
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIEmbedAuthor {
/**
* Name of author
*
* Length limit: 256 characters
*/
name: string;
/**
* URL of author
*/
url?: string;
/**
* URL of author icon (only supports http(s) and attachments)
*/
icon_url?: string;
/**
* A proxied url of author icon
*/
proxy_icon_url?: string;
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIEmbedFooter {
/**
* Footer text
*
* Length limit: 2048 characters
*/
text: string;
/**
* URL of footer icon (only supports http(s) and attachments)
*/
icon_url?: string;
/**
* A proxied url of footer icon
*/
proxy_icon_url?: string;
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIEmbedField {
/**
* Name of the field
*
* Length limit: 256 characters
*/
name: string;
/**
* Value of the field
*
* Length limit: 1024 characters
*/
value: string;
/**
* Whether or not this field should display inline
*/
inline?: boolean;
}
/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIAttachment {
/**
* Attachment id
*/
id: Snowflake;
/**
* Name of file attached
*/
filename: string;
/**
* Description for the file
*/
description?: string;
/**
* The attachment's media type
*
* See https://en.wikipedia.org/wiki/Media_type
*/
content_type?: string;
/**
* Size of file in bytes
*/
size: number;
/**
* Source url of file
*/
url: string;
/**
* A proxied url of file
*/
proxy_url: string;
/**
* Height of file (if image)
*/
height?: number | null;
/**
* Width of file (if image)
*/
width?: number | null;
/**
* Whether this attachment is ephemeral
*/
ephemeral?: boolean;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIChannelMention {
/**
* ID of the channel
*/
id: Snowflake;
/**
* ID of the guild containing the channel
*/
guild_id: Snowflake;
/**
* The type of channel
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*/
type: ChannelType;
/**