Skip to content

Commit

Permalink
Add satisfies BitFlags constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
IanMitchell committed Nov 10, 2023
1 parent 9e0bb30 commit 2c52eaa
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
4 changes: 3 additions & 1 deletion packages/discord-bitflag/src/flags/application.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { BitFlags } from "bitflag-js";

export const ApplicationFlags = Object.freeze({
ApplicationAutoModerationRuleCreateBadge: 1n << 6n,
GatewayPresence: 1n << 12n,
Expand All @@ -9,4 +11,4 @@ export const ApplicationFlags = Object.freeze({
GatewayMessageContent: 1n << 18n,
GatewayMessageContentLimited: 1n << 19n,
ApplicationCommandBadge: 1n << 23n,
});
}) satisfies BitFlags;
4 changes: 3 additions & 1 deletion packages/discord-bitflag/src/flags/channel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { BitFlags } from "bitflag-js";

export const ChannelFlags = Object.freeze({
Pinned: 1n << 1n,
RequireTag: 1n << 4n,
HideMediaDownloadOptions: 1n << 15n,
});
}) satisfies BitFlags;
4 changes: 3 additions & 1 deletion packages/discord-bitflag/src/flags/guild-member.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { BitFlags } from "bitflag-js";

export const GuildMemberFlags = Object.freeze({
DidRejoin: 1n << 0n,
CompletedOnboarding: 1n << 1n,
BypassesVerification: 1n << 2n,
StartedOnboarding: 1n << 3n,
});
}) satisfies BitFlags;
4 changes: 3 additions & 1 deletion packages/discord-bitflag/src/flags/intents.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { BitFlags } from "bitflag-js";

export const IntentFlags = Object.freeze({
Guilds: 1n << 0n,
GuildMembers: 1n << 1n,
Expand All @@ -18,4 +20,4 @@ export const IntentFlags = Object.freeze({
GuildScheduledEvents: 1n << 16n,
AutoModerationConfiguration: 1n << 20n,
AutoModerationExecution: 1n << 21n,
});
}) satisfies BitFlags;
4 changes: 3 additions & 1 deletion packages/discord-bitflag/src/flags/message.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { BitFlags } from "bitflag-js";

export const MessageFlags = Object.freeze({
Crossposted: 1n << 0n,
IsCrosspost: 1n << 1n,
Expand All @@ -10,4 +12,4 @@ export const MessageFlags = Object.freeze({
FailedToMentionSomeRolesInThread: 1n << 8n,
SuppressNotifications: 1n << 12n,
IsVoiceMessage: 1n << 13n,
});
}) satisfies BitFlags;
4 changes: 3 additions & 1 deletion packages/discord-bitflag/src/flags/permissions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { BitFlags } from "bitflag-js";

export const PermissionFlags = Object.freeze({
CreateInstantInvite: 1n << 0n,
KickMembers: 1n << 1n,
Expand Down Expand Up @@ -44,4 +46,4 @@ export const PermissionFlags = Object.freeze({
UseSoundboard: 1n << 42n,
UseExternalSounds: 1n << 45n,
SendVoiceMessages: 1n << 46n,
});
}) satisfies BitFlags;
4 changes: 3 additions & 1 deletion packages/discord-bitflag/src/flags/user.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { BitFlags } from "bitflag-js";

export const UserFlags = Object.freeze({
Staff: 1n << 0n,
Partner: 1n << 1n,
Expand All @@ -14,4 +16,4 @@ export const UserFlags = Object.freeze({
CertifiedModerator: 1n << 18n,
BotHttpInteractions: 1n << 19n,
ActiveDeveloper: 1n << 22n,
});
}) satisfies BitFlags;

0 comments on commit 2c52eaa

Please sign in to comment.