Skip to content

Commit f1257b1

Browse files
committed
feat(Message): add more attachment flags and fields
1 parent 27840d1 commit f1257b1

File tree

4 files changed

+288
-0
lines changed

4 files changed

+288
-0
lines changed

deno/payloads/v10/channel.ts

+72
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,14 @@ export interface APIEmbed {
12261226
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
12271227
*/
12281228
fields?: APIEmbedField[];
1229+
/**
1230+
* Embed flags combined as a bitfield
1231+
*
1232+
* See https://discord.com/developers/docs/resources/message#embed-object-embed-flags
1233+
*
1234+
* See https://en.wikipedia.org/wiki/Bit_field
1235+
*/
1236+
flags?: EmbedFlags;
12291237
}
12301238

12311239
/**
@@ -1268,6 +1276,19 @@ export enum EmbedType {
12681276
PollResult = 'poll_result',
12691277
}
12701278

1279+
export enum EmbedFlags {
1280+
/**
1281+
* This embed was flagged as sensitive content
1282+
*
1283+
* See https://support.discord.com/hc/en-us/articles/18210995019671
1284+
*/
1285+
ContainsExplicitMedia = 1 << 4,
1286+
/**
1287+
* This embed is a reply to an activity card and is no longer displayed
1288+
*/
1289+
IsContentInventoryEntry = 1 << 5,
1290+
}
1291+
12711292
/**
12721293
* https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
12731294
*/
@@ -1332,6 +1353,21 @@ export interface APIEmbedImage {
13321353
* Width of image
13331354
*/
13341355
width?: number;
1356+
/**
1357+
* Embed media flags combined as a bitfield
1358+
*
1359+
* See https://discord.com/developers/docs/resources/message#embed-object-embed-media-flags
1360+
*
1361+
* See https://en.wikipedia.org/wiki/Bit_field
1362+
*/
1363+
flags?: EmbedMediaFlags;
1364+
}
1365+
1366+
export enum EmbedMediaFlags {
1367+
/**
1368+
* This image is animated
1369+
*/
1370+
IsAnimated = 1 << 5,
13351371
}
13361372

13371373
/**
@@ -1476,16 +1512,52 @@ export interface APIAttachment {
14761512
* Attachment flags combined as a bitfield
14771513
*/
14781514
flags?: AttachmentFlags;
1515+
/**
1516+
* For Clips, array of users who were in the stream
1517+
*/
1518+
clip_participants?: APIUser[];
1519+
/**
1520+
* For Clips, when the clip was created
1521+
*/
1522+
clip_created_at?: string;
1523+
/**
1524+
* For Clips, the application in the stream, if recognized
1525+
*/
1526+
application?: APIApplication | null;
14791527
}
14801528

14811529
/**
14821530
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
14831531
*/
14841532
export enum AttachmentFlags {
1533+
/**
1534+
* This attachment is a Clip from a stream
1535+
*
1536+
* See https://support.discord.com/hc/en-us/articles/16861982215703
1537+
*/
1538+
IsClip = 1 << 0,
1539+
/**
1540+
* This attachment is the thumbnail of a thread in a media channel, displayed in the grid but not on the message
1541+
*/
1542+
IsThumbnail = 1 << 1,
14851543
/**
14861544
* This attachment has been edited using the remix feature on mobile
14871545
*/
14881546
IsRemix = 1 << 2,
1547+
/**
1548+
* This attachment was marked as a spoiler and is blurred until clicked
1549+
*/
1550+
IsSpoiler = 1 << 3,
1551+
/**
1552+
* This attachment was flagged as sensitive content
1553+
*
1554+
* See https://support.discord.com/hc/en-us/articles/18210995019671
1555+
*/
1556+
ContainsExplicitMedia = 1 << 4,
1557+
/**
1558+
* This attachment is an animated image
1559+
*/
1560+
IsAnimated = 1 << 5,
14891561
}
14901562

14911563
/**

deno/payloads/v9/channel.ts

+72
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,14 @@ export interface APIEmbed {
11931193
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
11941194
*/
11951195
fields?: APIEmbedField[];
1196+
/**
1197+
* Embed flags combined as a bitfield
1198+
*
1199+
* See https://discord.com/developers/docs/resources/message#embed-object-embed-flags
1200+
*
1201+
* See https://en.wikipedia.org/wiki/Bit_field
1202+
*/
1203+
flags?: EmbedFlags;
11961204
}
11971205

11981206
/**
@@ -1235,6 +1243,19 @@ export enum EmbedType {
12351243
PollResult = 'poll_result',
12361244
}
12371245

1246+
export enum EmbedFlags {
1247+
/**
1248+
* This embed was flagged as sensitive content
1249+
*
1250+
* See https://support.discord.com/hc/en-us/articles/18210995019671
1251+
*/
1252+
ContainsExplicitMedia = 1 << 4,
1253+
/**
1254+
* This embed is a reply to an activity card and is no longer displayed
1255+
*/
1256+
IsContentInventoryEntry = 1 << 5,
1257+
}
1258+
12381259
/**
12391260
* https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
12401261
*/
@@ -1299,6 +1320,21 @@ export interface APIEmbedImage {
12991320
* Width of image
13001321
*/
13011322
width?: number;
1323+
/**
1324+
* Embed media flags combined as a bitfield
1325+
*
1326+
* See https://discord.com/developers/docs/resources/message#embed-object-embed-media-flags
1327+
*
1328+
* See https://en.wikipedia.org/wiki/Bit_field
1329+
*/
1330+
flags?: EmbedMediaFlags;
1331+
}
1332+
1333+
export enum EmbedMediaFlags {
1334+
/**
1335+
* This image is animated
1336+
*/
1337+
IsAnimated = 1 << 5,
13021338
}
13031339

13041340
/**
@@ -1443,16 +1479,52 @@ export interface APIAttachment {
14431479
* Attachment flags combined as a bitfield
14441480
*/
14451481
flags?: AttachmentFlags;
1482+
/**
1483+
* For Clips, array of users who were in the stream
1484+
*/
1485+
clip_participants?: APIUser[];
1486+
/**
1487+
* For Clips, when the clip was created
1488+
*/
1489+
clip_created_at?: string;
1490+
/**
1491+
* For Clips, the application in the stream, if recognized
1492+
*/
1493+
application?: APIApplication | null;
14461494
}
14471495

14481496
/**
14491497
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
14501498
*/
14511499
export enum AttachmentFlags {
1500+
/**
1501+
* This attachment is a Clip from a stream
1502+
*
1503+
* See https://support.discord.com/hc/en-us/articles/16861982215703
1504+
*/
1505+
IsClip = 1 << 0,
1506+
/**
1507+
* This attachment is the thumbnail of a thread in a media channel, displayed in the grid but not on the message
1508+
*/
1509+
IsThumbnail = 1 << 1,
14521510
/**
14531511
* This attachment has been edited using the remix feature on mobile
14541512
*/
14551513
IsRemix = 1 << 2,
1514+
/**
1515+
* This attachment was marked as a spoiler and is blurred until clicked
1516+
*/
1517+
IsSpoiler = 1 << 3,
1518+
/**
1519+
* This attachment was flagged as sensitive content
1520+
*
1521+
* See https://support.discord.com/hc/en-us/articles/18210995019671
1522+
*/
1523+
ContainsExplicitMedia = 1 << 4,
1524+
/**
1525+
* This attachment is an animated image
1526+
*/
1527+
IsAnimated = 1 << 5,
14561528
}
14571529

14581530
/**

payloads/v10/channel.ts

+72
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,14 @@ export interface APIEmbed {
12261226
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
12271227
*/
12281228
fields?: APIEmbedField[];
1229+
/**
1230+
* Embed flags combined as a bitfield
1231+
*
1232+
* See https://discord.com/developers/docs/resources/message#embed-object-embed-flags
1233+
*
1234+
* See https://en.wikipedia.org/wiki/Bit_field
1235+
*/
1236+
flags?: EmbedFlags;
12291237
}
12301238

12311239
/**
@@ -1268,6 +1276,19 @@ export enum EmbedType {
12681276
PollResult = 'poll_result',
12691277
}
12701278

1279+
export enum EmbedFlags {
1280+
/**
1281+
* This embed was flagged as sensitive content
1282+
*
1283+
* See https://support.discord.com/hc/en-us/articles/18210995019671
1284+
*/
1285+
ContainsExplicitMedia = 1 << 4,
1286+
/**
1287+
* This embed is a reply to an activity card and is no longer displayed
1288+
*/
1289+
IsContentInventoryEntry = 1 << 5,
1290+
}
1291+
12711292
/**
12721293
* https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
12731294
*/
@@ -1332,6 +1353,21 @@ export interface APIEmbedImage {
13321353
* Width of image
13331354
*/
13341355
width?: number;
1356+
/**
1357+
* Embed media flags combined as a bitfield
1358+
*
1359+
* See https://discord.com/developers/docs/resources/message#embed-object-embed-media-flags
1360+
*
1361+
* See https://en.wikipedia.org/wiki/Bit_field
1362+
*/
1363+
flags?: EmbedMediaFlags;
1364+
}
1365+
1366+
export enum EmbedMediaFlags {
1367+
/**
1368+
* This image is animated
1369+
*/
1370+
IsAnimated = 1 << 5,
13351371
}
13361372

13371373
/**
@@ -1476,16 +1512,52 @@ export interface APIAttachment {
14761512
* Attachment flags combined as a bitfield
14771513
*/
14781514
flags?: AttachmentFlags;
1515+
/**
1516+
* For Clips, array of users who were in the stream
1517+
*/
1518+
clip_participants?: APIUser[];
1519+
/**
1520+
* For Clips, when the clip was created
1521+
*/
1522+
clip_created_at?: string;
1523+
/**
1524+
* For Clips, the application in the stream, if recognized
1525+
*/
1526+
application?: APIApplication | null;
14791527
}
14801528

14811529
/**
14821530
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
14831531
*/
14841532
export enum AttachmentFlags {
1533+
/**
1534+
* This attachment is a Clip from a stream
1535+
*
1536+
* See https://support.discord.com/hc/en-us/articles/16861982215703
1537+
*/
1538+
IsClip = 1 << 0,
1539+
/**
1540+
* This attachment is the thumbnail of a thread in a media channel, displayed in the grid but not on the message
1541+
*/
1542+
IsThumbnail = 1 << 1,
14851543
/**
14861544
* This attachment has been edited using the remix feature on mobile
14871545
*/
14881546
IsRemix = 1 << 2,
1547+
/**
1548+
* This attachment was marked as a spoiler and is blurred until clicked
1549+
*/
1550+
IsSpoiler = 1 << 3,
1551+
/**
1552+
* This attachment was flagged as sensitive content
1553+
*
1554+
* See https://support.discord.com/hc/en-us/articles/18210995019671
1555+
*/
1556+
ContainsExplicitMedia = 1 << 4,
1557+
/**
1558+
* This attachment is an animated image
1559+
*/
1560+
IsAnimated = 1 << 5,
14891561
}
14901562

14911563
/**

0 commit comments

Comments
 (0)