Skip to content

Commit 2f90f9e

Browse files
authored
feat: attachment flags (#259)
1 parent 2311939 commit 2f90f9e

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { BitFlags } from "bitflag-js";
2+
3+
export const AttachmentFlags = Object.freeze({
4+
IsClip: 1n << 0n,
5+
IsThumbnail: 1n << 1n,
6+
IsRemix: 1n << 2n,
7+
IsSpoiler: 1n << 3n,
8+
IsAnimated: 1n << 5n,
9+
}) satisfies BitFlags;

packages/discord-bitflag/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ export { BitField, type BitFlagResolvable, type BitFlags } from "bitflag-js";
33
export { ApplicationFlags } from "./flags/application.js";
44
export { ApplicationFlagsBitField } from "./wrappers/applications.js";
55

6+
export { AttachmentFlags } from "./flags/attachment.js";
7+
export { AttachmentFlagsBitField } from "./wrappers/attachments.js";
8+
69
export { ChannelFlags } from "./flags/channel.js";
710
export { ChannelFlagsBitField } from "./wrappers/channels.js";
811

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { BitField } from "bitflag-js";
2+
import { AttachmentFlags } from "../flags/attachment.js";
3+
4+
export class AttachmentFlagsBitField extends BitField {
5+
static ALL = BitField.resolve(Object.values(AttachmentFlags));
6+
}

0 commit comments

Comments
 (0)