-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReference.json
912 lines (912 loc) · 35.7 KB
/
Reference.json
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
{
"content": [
"|API Reference"
],
"API Reference": {
"level": 1,
"url": "https://discord.com/developers/docs/docs/reference#api-reference",
"content": [
"Discord's API is based around two core layers, a HTTPS/REST API for general operations, and persistent secure WebSocket based connection for sending and subscribing to real-time events. The most common use case of the Discord API will be providing a service, or access to a platform through the OAuth2 API.",
"|Base URL",
"|API Versioning",
"|Error Messages",
"|Authentication",
"|Encryption",
"|Snowflakes",
"|ID Serialization",
"|ISO8601 Date/Time",
"|Nullable and Optional Resource Fields",
"|Consistency",
"|HTTP API",
"|Gateway (WebSocket) API",
"|Message Formatting",
"|Image Formatting",
"|Image Data",
"|Uploading Files",
"|Locales"
],
"Base URL": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#api-reference-base-url",
"content": [
{
"language": "",
"code": "https://discord.com/api\n"
}
]
},
"API Versioning": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#api-versioning",
"content": [
"> danger\n> Some API and Gateway versions are now non-functioning, and are labeled as discontinued in the table below for posterity. Trying to use these versions will fail and return 400 Bad Request.",
"Discord exposes different versions of our API. You should specify which version to use by including it in the request path like https://discord.com/api/v{version_number}. Omitting the version number from the route will route requests to the current default version (marked below). You can find the change log for the newest API version here.",
"|API Versions"
],
"API Versions": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#api-versioning-api-versions",
"content": [
[
[
"Version",
"Status",
"Default"
],
[
"10",
"Available",
""
],
[
"9",
"Available",
""
],
[
"8",
"Deprecated",
""
],
[
"7",
"Deprecated",
""
],
[
"6",
"Deprecated",
"\u2713"
],
[
"5",
"Discontinued",
""
],
[
"4",
"Discontinued",
""
],
[
"3",
"Discontinued",
""
]
]
]
}
},
"Error Messages": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#error-messages",
"content": [
"Starting in API v8, we've improved error formatting in form error responses. The response will tell you which JSON key contains the error, the error code, and a human readable error message. We will be frequently adding new error messages, so a complete list of errors is not feasible and would be almost instantly out of date. Here are some examples instead:",
"|Array Error",
"|Object Error",
"|Request Error"
],
"Array Error": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#error-messages-array-error",
"content": [
{
"language": "json",
"code": "{\n \"code\": 50035,\n \"errors\": {\n \"activities\": {\n \"0\": {\n \"platform\": {\n \"_errors\": [\n {\n \"code\": \"BASE_TYPE_CHOICES\",\n \"message\": \"Value must be one of ('desktop', 'android', 'ios').\"\n }\n ]\n },\n \"type\": {\n \"_errors\": [\n {\n \"code\": \"BASE_TYPE_CHOICES\",\n \"message\": \"Value must be one of (0, 1, 2, 3, 4, 5).\"\n }\n ]\n }\n }\n }\n },\n \"message\": \"Invalid Form Body\"\n}\n"
}
]
},
"Object Error": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#error-messages-object-error",
"content": [
{
"language": "json",
"code": "{\n \"code\": 50035,\n \"errors\": {\n \"access_token\": {\n \"_errors\": [\n {\n \"code\": \"BASE_TYPE_REQUIRED\",\n \"message\": \"This field is required\"\n }\n ]\n }\n },\n \"message\": \"Invalid Form Body\"\n}\n"
}
]
},
"Request Error": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#error-messages-request-error",
"content": [
{
"language": "json",
"code": "{\n \"code\": 50035,\n \"message\": \"Invalid Form Body\",\n \"errors\": {\n \"_errors\": [\n {\n \"code\": \"APPLICATION_COMMAND_TOO_LARGE\",\n \"message\": \"Command exceeds maximum size (4000)\"\n }\n ]\n }\n}\n"
}
]
}
},
"Authentication": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#authentication",
"content": [
"Authenticating with the Discord API can be done in one of two ways:",
[
"Using a bot token gained by registering a bot, for more information on bots see bots vs user accounts.",
"Using an OAuth2 bearer token gained through the OAuth2 API."
],
"For all authentication types, authentication is performed with the Authorization HTTP header in the format Authorization: TOKEN_TYPE TOKEN.",
"|Example Bot Token Authorization Header",
"|Example Bearer Token Authorization Header"
],
"Example Bot Token Authorization Header": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#authentication-example-bot-token-authorization-header",
"content": [
{
"language": "",
"code": "Authorization: Bot MTk4NjIyNDgzNDcxOTI1MjQ4.Cl2FMQ.ZnCjm1XVW7vRze4b7Cq4se7kKWs\n"
}
]
},
"Example Bearer Token Authorization Header": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#authentication-example-bearer-token-authorization-header",
"content": [
{
"language": "",
"code": "Authorization: Bearer CZhtkLDpNYXgPH9Ml6shqh2OwykChw\n"
}
]
}
},
"Encryption": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#encryption",
"content": [
"All HTTP-layer services and protocols (e.g. HTTP, WebSocket) within the Discord API are using TLS 1.2."
]
},
"Snowflakes": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#snowflakes",
"content": [
"Discord utilizes Twitter's snowflake format for uniquely identifiable descriptors (IDs). These IDs are guaranteed to be unique across all of Discord, except in some unique scenarios in which child objects share their parent's ID. Because Snowflake IDs are up to 64 bits in size (e.g. a uint64), they are always returned as strings in the HTTP API to prevent integer overflows in some languages. See Gateway ETF/JSON for more information regarding Gateway encoding.",
"|Snowflake ID Broken Down in Binary",
"|Snowflake ID Format Structure (Left to Right)",
"|Convert Snowflake to DateTime",
"|Snowflake IDs in Pagination"
],
"Snowflake ID Broken Down in Binary": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#snowflakes-snowflake-id-broken-down-in-binary",
"content": [
{
"language": "",
"code": "111111111111111111111111111111111111111111 11111 11111 111111111111\n64 22 17 12 0\n"
}
]
},
"Snowflake ID Format Structure (Left to Right)": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#snowflakes-snowflake-id-format-structure-(left-to-right)",
"content": [
[
[
"Field",
"Bits",
"Number of bits",
"Description",
"Retrieval"
],
[
"Timestamp",
"63 to 22",
"42 bits",
"Milliseconds since Discord Epoch, the first second of 2015 or 1420070400000.",
"(snowflake >> 22) + 1420070400000"
],
[
"Internal worker ID",
"21 to 17",
"5 bits",
"",
"(snowflake & 0x3E0000) >> 17"
],
[
"Internal process ID",
"16 to 12",
"5 bits",
"",
"(snowflake & 0x1F000) >> 12"
],
[
"Increment",
"11 to 0",
"12 bits",
"For every ID that is generated on that process, this number is incremented",
"snowflake & 0xFFF"
]
]
]
},
"Convert Snowflake to DateTime": {
"level": 3,
"url": "https://discord.com/developers/docs/docs/reference#convert-snowflake-to-datetime",
"content": [
"Graphical representation of how a Snowflake is constructed"
]
},
"Snowflake IDs in Pagination": {
"level": 3,
"url": "https://discord.com/developers/docs/docs/reference#snowflake-ids-in-pagination",
"content": [
"We typically use snowflake IDs in many of our API routes for pagination. The standardized pagination paradigm we utilize is one in which you can specify IDs before and after in combination with limit to retrieve a desired page of results. You will want to refer to the specific endpoint documentation for details.",
"It is useful to note that snowflake IDs are just numbers with a timestamp, so when dealing with pagination where you want results from the beginning of time (in Discord Epoch, but 0 works here too) or before/after a specific time you can generate a snowflake ID for that time.",
"|Generating a snowflake ID from a Timestamp Example"
],
"Generating a snowflake ID from a Timestamp Example": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#snowflake-ids-in-pagination-generating-a-snowflake-id-from-a-timestamp-example",
"content": [
{
"language": "",
"code": "(timestamp_ms - DISCORD_EPOCH) << 22\n"
}
]
}
}
},
"ID Serialization": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#id-serialization",
"content": [
"There are some cases in which our API and Gateway may return IDs in an unexpected format. Internally, Discord stores IDs as integer snowflakes. When we serialize IDs to JSON, we transform bigints into strings. Given that all Discord IDs are snowflakes, you should always expect a string.",
"However, there are cases in which passing something to our API will instead return IDs serialized as an integer; this is the case when you send our API or Gateway a value in an id field that is not bigint size. For example, when requesting GUILD_MEMBERS_CHUNK from our gateway:",
{
"language": "",
"code": "// Send\n{\n op: 8,\n d: {\n guild_id: '308994132968210433',\n user_ids: [ '123123' ]\n }\n}\n\n// Receive\n{\n t: 'GUILD_MEMBERS_CHUNK',\n s: 3,\n op: 0,\n d: {\n not_found: [ 123123 ],\n members: [],\n guild_id: '308994132968210433'\n }\n}\n"
},
"You can see in this case that the sent user_id is not a bigint; therefore, when it is serialized back to JSON by Discord, it is not transformed into a string. This will never happen with IDs that come from Discord. But, this can happen if you send malformed data in your requests."
]
},
"ISO8601 Date/Time": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#iso8601-date/time",
"content": [
"Discord utilizes the ISO8601 format for most Date/Times returned in our models. This format is referred to as type ISO8601 within tables in this documentation."
]
},
"Nullable and Optional Resource Fields": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#nullable-and-optional-resource-fields",
"content": [
"Resource fields that may contain a null value have types that are prefixed with a question mark.\nResource fields that are optional have names that are suffixed with a question mark.",
"|Example Nullable and Optional Fields"
],
"Example Nullable and Optional Fields": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#nullable-and-optional-resource-fields-example-nullable-and-optional-fields",
"content": [
[
[
"Field",
"Type"
],
[
"optional_field?",
"string"
],
[
"nullable_field",
"?string"
],
[
"optional_and_nullable_field?",
"?string"
]
]
]
}
},
"Consistency": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#consistency",
"content": [
"Discord operates at a scale where true consistency is impossible. Because of this, lots of operations in our API and in-between our services are eventually consistent. Due to this, client actions can never be serialized and may be executed in any order (if executed at all). Along with these constraints, events in Discord may:",
[
"Never be sent to a client",
"Be sent exactly one time to the client",
"Be sent up to N times per client"
],
"Clients should operate on events and results from the API in as much of an idempotent behavior as possible."
]
},
"HTTP API": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#http-api",
"content": [
"|User Agent",
"|Rate Limiting",
"|Boolean Query Strings"
],
"User Agent": {
"level": 3,
"url": "https://discord.com/developers/docs/docs/reference#user-agent",
"content": [
"Clients using the HTTP API must provide a valid User Agent which specifies information about the client library and version in the following format:",
"|User Agent Example"
],
"User Agent Example": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#user-agent-user-agent-example",
"content": [
{
"language": "",
"code": "User-Agent: DiscordBot ($url, $versionNumber)\n"
},
"Clients may append more information and metadata to the end of this string as they wish.",
"> warn\n> Client requests that do not have a valid User Agent specified may be blocked and return a Cloudflare error."
]
}
},
"Rate Limiting": {
"level": 3,
"url": "https://discord.com/developers/docs/docs/reference#rate-limiting",
"content": [
"The HTTP API implements a process for limiting and preventing excessive requests in accordance with RFC 6585. API users that regularly hit and ignore rate limits will have their API keys revoked, and be blocked from the platform. For more information on rate limiting of requests, please see the Rate Limits section."
]
},
"Boolean Query Strings": {
"level": 3,
"url": "https://discord.com/developers/docs/docs/reference#boolean-query-strings",
"content": [
"Certain endpoints in the API are documented to accept booleans for their query string parameters. While there is no standard system for boolean representation in query string parameters, Discord represents such cases using True, true, or 1 for true and False, false or 0 for false."
]
}
},
"Gateway (WebSocket) API": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#gateway-(websocket)-api",
"content": [
"Discord's Gateway API is used for maintaining persistent, stateful websocket connections between your client and our servers. These connections are used for sending and receiving real-time events your client can use to track and update local state. The Gateway API uses secure websocket connections as specified in RFC 6455. For information on opening Gateway connections, please see the Gateway API section."
]
},
"Message Formatting": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#message-formatting",
"content": [
"Discord utilizes a subset of markdown for rendering message content on its clients, while also adding some custom functionality to enable things like mentioning users and channels. This functionality uses the following formats:",
"|Formats",
"|Timestamp Styles"
],
"Formats": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#message-formatting-formats",
"content": [
[
[
"Type",
"Structure",
"Example"
],
[
"User",
"<@USER_ID>",
"<@80351110224678912>"
],
[
"User *",
"<@!USER_ID>",
"<@!80351110224678912>"
],
[
"Channel",
"<#CHANNEL_ID>",
"<#103735883630395392>"
],
[
"Role",
"<@&ROLE_ID>",
"<@&165511591545143296>"
],
[
"Slash Command **",
"</NAME:COMMAND_ID>",
"</airhorn:816437322781949972>"
],
[
"Standard Emoji",
"Unicode Characters",
"\ud83d\udcaf"
],
[
"Custom Emoji",
"<:NAME:ID>",
"<:mmLol:216154654256398347>"
],
[
"Custom Emoji (Animated)",
"<a:NAME:ID>",
"<a:b1nzy:392938283556143104>"
],
[
"Unix Timestamp",
"<t:TIMESTAMP>",
"<t:1618953630>"
],
[
"Unix Timestamp (Styled)",
"<t:TIMESTAMP:STYLE>",
"<t:1618953630:d>"
]
],
"Using the markdown for either users, roles, or channels will usually mention the target(s) accordingly, but this can be suppressed using the allowed_mentions parameter when creating a message. Standard emoji are currently rendered using Twemoji for Desktop/Android and Apple's native emoji on iOS.",
"Timestamps are expressed in seconds and display the given timestamp in the user's timezone and locale.",
"* User mentions with an exclamation mark are deprecated and should be handled like any other user mention.",
"** Subcommands and subcommand groups can also be mentioned by using respectively </NAME SUBCOMMAND:ID> and </NAME SUBCOMMAND_GROUP SUBCOMMAND:ID>."
]
},
"Timestamp Styles": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#message-formatting-timestamp-styles",
"content": [
[
[
"Style",
"Example Output",
"Description"
],
[
"t",
"16:20",
"Short Time"
],
[
"T",
"16:20:30",
"Long Time"
],
[
"d",
"20/04/2021",
"Short Date"
],
[
"D",
"20 April 2021",
"Long Date"
],
[
"f *",
"20 April 2021 16:20",
"Short Date/Time"
],
[
"F",
"Tuesday, 20 April 2021 16:20",
"Long Date/Time"
],
[
"R",
"2 months ago",
"Relative Time"
]
],
"*default"
]
}
},
"Image Formatting": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#image-formatting",
"content": [
"|Image Base Url",
"|Image Formats",
"|CDN Endpoints"
],
"Image Base Url": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#image-formatting-image-base-url",
"content": [
{
"language": "",
"code": "https://cdn.discordapp.com/\n"
},
"Discord uses ids and hashes to render images in the client. These hashes can be retrieved through various API requests, like Get User. Below are the formats, size limitations, and CDN endpoints for images in Discord. The returned format can be changed by changing the extension name at the end of the URL. The returned size can be changed by appending a querystring of ?size=desired_size to the URL. Image size can be any power of two between 16 and 4096."
]
},
"Image Formats": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#image-formatting-image-formats",
"content": [
[
[
"Name",
"Extension"
],
[
"JPEG",
".jpg, .jpeg"
],
[
"PNG",
".png"
],
[
"WebP",
".webp"
],
[
"GIF",
".gif"
],
[
"Lottie",
".json"
]
]
]
},
"CDN Endpoints": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#image-formatting-cdn-endpoints",
"content": [
[
[
"Type",
"Path",
"Supports"
],
[
"Custom Emoji",
"emojis/emoji_id.png",
"PNG, JPEG, WebP, GIF"
],
[
"Guild Icon",
"icons/guild_id/guild_icon.png *",
"PNG, JPEG, WebP, GIF"
],
[
"Guild Splash",
"splashes/guild_id/guild_splash.png",
"PNG, JPEG, WebP"
],
[
"Guild Discovery Splash",
"discovery-splashes/guild_id/guild_discovery_splash.png",
"PNG, JPEG, WebP"
],
[
"Guild Banner",
"banners/guild_id/guild_banner.png *",
"PNG, JPEG, WebP, GIF"
],
[
"User Banner",
"banners/user_id/user_banner.png *",
"PNG, JPEG, WebP, GIF"
],
[
"Default User Avatar",
"embed/avatars/user_discriminator.png ** ***",
"PNG"
],
[
"User Avatar",
"avatars/user_id/user_avatar.png *",
"PNG, JPEG, WebP, GIF"
],
[
"Guild Member Avatar",
"guilds/guild_id/users/user_id/avatars/member_avatar.png *",
"PNG, JPEG, WebP, GIF"
],
[
"Application Icon",
"app-icons/application_id/icon.png",
"PNG, JPEG, WebP"
],
[
"Application Cover",
"app-icons/application_id/cover_image.png",
"PNG, JPEG, WebP"
],
[
"Application Asset",
"app-assets/application_id/asset_id.png",
"PNG, JPEG, WebP"
],
[
"Achievement Icon",
"app-assets/application_id/achievements/achievement_id/icons/icon_hash.png",
"PNG, JPEG, WebP"
],
[
"Store Page Asset",
"app-assets/application_id/store/asset_id",
"PNG, JPEG, WebP"
],
[
"Sticker Pack Banner",
"app-assets/710982414301790216/store/sticker_pack_banner_asset_id.png",
"PNG, JPEG, WebP"
],
[
"Team Icon",
"team-icons/team_id/team_icon.png",
"PNG, JPEG, WebP"
],
[
"Sticker",
"stickers/sticker_id.png *** ****",
"PNG, Lottie, GIF"
],
[
"Role Icon",
"role-icons/role_id/role_icon.png",
"PNG, JPEG, WebP"
],
[
"Guild Scheduled Event Cover",
"guild-events/scheduled_event_id/scheduled_event_cover_image.png",
"PNG, JPEG, WebP"
],
[
"Guild Member Banner",
"guilds/guild_id/users/user_id/banners/member_banner.png *",
"PNG, JPEG, WebP, GIF"
]
],
"* In the case of endpoints that support GIFs, the hash will begin with a_ if it is available in GIF format. (example: a_1269e74af4df7417b13759eae50c83dc)",
"** In the case of the Default User Avatar endpoint, the value for user_discriminator in the path should be the user's discriminator modulo 5\u2014Test#1337 would be 1337 % 5, which evaluates to 2.",
"*** In the case of the Default User Avatar and Sticker endpoints, the size of images returned is constant with the \"size\" querystring parameter being ignored.",
"**** In the case of the Sticker endpoint, the sticker will be available as PNG if its format_type is PNG or APNG, GIF if its format_type is GIF, and as Lottie if its format_type is LOTTIE."
]
}
},
"Image Data": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#image-data",
"content": [
"Image data is a Data URI scheme that supports JPG, GIF, and PNG formats. An example Data URI format is:",
{
"language": "",
"code": "data:image/jpeg;base64,BASE64_ENCODED_JPEG_IMAGE_DATA\n"
},
"Ensure you use the proper content type (image/jpeg, image/png, image/gif) that matches the image data being provided."
]
},
"Uploading Files": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#uploading-files",
"content": [
"> info\n> A file upload size limit applies to all files in a request (rather than each individual file). While the limit depends on the Boost Tier of a guild, it is 8 MiB by default.",
"Some endpoints support file attachments, indicated by the files[n] parameter. To add file(s), the standard application/json body must be replaced by a multipart/form-data body. The JSON message body can optionally be provided using the payload_json parameter.",
"All files[n] parameters must include a valid Content-Disposition subpart header with a filename and unique name parameter. Each file parameter must be uniquely named in the format files[n] such as files[0], files[1], or files[42]. The suffixed index n is the snowflake placeholder that can be used in the attachments field, which can be passed to the payload_json parameter (or Callback Data Payloads).",
"Images can also be referenced in embeds using the attachment://filename URL. The filename for these URLs must be ASCII alphanumeric with underscores, dashes, or dots. An example payload is provided below.",
"|Editing Message Attachments"
],
"Editing Message Attachments": {
"level": 3,
"url": "https://discord.com/developers/docs/docs/reference#editing-message-attachments",
"content": [
"The attachments JSON parameter includes all files that will be appended to the message, including new files and their respective snowflake placeholders (referenced above). When making a PATCH request, only files listed in the attachments parameter will be appended to the message. Any previously-added files that aren't included will be removed.",
"|Example Request Bodies (multipart/form-data)",
"|Using Attachments within Embeds"
],
"Example Request Bodies (multipart/form-data)": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#editing-message-attachments-example-request-bodies-(multipart/form-data)",
"content": [
"Note that these examples are small sections of an HTTP request to demonstrate behaviour of this endpoint - client libraries will set their own form boundaries (boundary is just an example). For more information, refer to the multipart/form-data spec.",
"This example demonstrates usage of the endpoint without payload_json.",
{
"language": "",
"code": "--boundary\nContent-Disposition: form-data; name=\"content\"\n\nHello, World!\n--boundary\nContent-Disposition: form-data; name=\"tts\"\n\ntrue\n--boundary--\n"
},
"This example demonstrates usage of the endpoint with payload_json and all content fields (content, embeds, files[n]) set.",
{
"language": "",
"code": "--boundary\nContent-Disposition: form-data; name=\"payload_json\"\nContent-Type: application/json\n\n{\n \"content\": \"Hello, World!\",\n \"embeds\": [{\n \"title\": \"Hello, Embed!\",\n \"description\": \"This is an embedded message.\",\n \"thumbnail\": {\n \"url\": \"attachment://myfilename.png\"\n },\n \"image\": {\n \"url\": \"attachment://mygif.gif\"\n }\n }],\n \"message_reference\": {\n \"message_id\": \"233648473390448641\"\n },\n \"attachments\": [{\n \"id\": 0,\n \"description\": \"Image of a cute little cat\",\n \"filename\": \"myfilename.png\"\n }, {\n \"id\": 1,\n \"description\": \"Rickroll gif\",\n \"filename\": \"mygif.gif\"\n }]\n}\n--boundary\nContent-Disposition: form-data; name=\"files[0]\"; filename=\"myfilename.png\"\nContent-Type: image/png\n\n[image bytes]\n--boundary\nContent-Disposition: form-data; name=\"files[1]\"; filename=\"mygif.gif\"\nContent-Type: image/gif\n\n[image bytes]\n--boundary--\n"
}
]
},
"Using Attachments within Embeds": {
"level": 6,
"url": "https://discord.com/developers/docs/docs/reference#editing-message-attachments-using-attachments-within-embeds",
"content": [
"You can upload attachments when creating a message and use those attachments within your embed. To do this, you will want to upload files as part of your multipart/form-data body. Make sure that you're uploading files which contain a filename, as you will need to reference it in your payload.",
"> warn\n> Only .jpg, .jpeg, .png, .webp, and .gif may be used at this time. Other file types are not supported.",
"Within an embed object, you can set an image to use an attachment as its URL with the attachment scheme syntax: attachment://filename.png",
"For example:",
{
"language": "json",
"code": "{\n \"embeds\": [{\n \"image\": {\n \"url\": \"attachment://screenshot.png\"\n }\n }]\n}\n"
}
]
}
}
},
"Locales": {
"level": 2,
"url": "https://discord.com/developers/docs/docs/reference#locales",
"content": [
[
[
"Locale",
"Language Name",
"Native Name"
],
[
"id",
"Indonesian",
"Bahasa Indonesia"
],
[
"da",
"Danish",
"Dansk"
],
[
"de",
"German",
"Deutsch"
],
[
"en-GB",
"English, UK",
"English, UK"
],
[
"en-US",
"English, US",
"English, US"
],
[
"es-ES",
"Spanish",
"Espa\u00f1ol"
],
[
"fr",
"French",
"Fran\u00e7ais"
],
[
"hr",
"Croatian",
"Hrvatski"
],
[
"it",
"Italian",
"Italiano"
],
[
"lt",
"Lithuanian",
"Lietuvi\u0161kai"
],
[
"hu",
"Hungarian",
"Magyar"
],
[
"nl",
"Dutch",
"Nederlands"
],
[
"no",
"Norwegian",
"Norsk"
],
[
"pl",
"Polish",
"Polski"
],
[
"pt-BR",
"Portuguese, Brazilian",
"Portugu\u00eas do Brasil"
],
[
"ro",
"Romanian, Romania",
"Rom\u00e2n\u0103"
],
[
"fi",
"Finnish",
"Suomi"
],
[
"sv-SE",
"Swedish",
"Svenska"
],
[
"vi",
"Vietnamese",
"Ti\u1ebfng Vi\u1ec7t"
],
[
"tr",
"Turkish",
"T\u00fcrk\u00e7e"
],
[
"cs",
"Czech",
"\u010ce\u0161tina"
],
[
"el",
"Greek",
"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"
],
[
"bg",
"Bulgarian",
"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438"
],
[
"ru",
"Russian",
"P\u0443\u0441\u0441\u043a\u0438\u0439"
],
[
"uk",
"Ukrainian",
"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"
],
[
"hi",
"Hindi",
"\u0939\u093f\u0928\u094d\u0926\u0940"
],
[
"th",
"Thai",
"\u0e44\u0e17\u0e22"
],
[
"zh-CN",
"Chinese, China",
"\u4e2d\u6587"
],
[
"ja",
"Japanese",
"\u65e5\u672c\u8a9e"
],
[
"zh-TW",
"Chinese, Taiwan",
"\u7e41\u9ad4\u4e2d\u6587"
],
[
"ko",
"Korean",
"\ud55c\uad6d\uc5b4"
]
]
]
}
}
}