fix(bot): use bigint instead of PermissionStrings[] for allow and deny in channel.permissionOverwrites to match Overwrite type (#4736)

This commit is contained in:
Awesome Stickz
2026-02-04 13:21:34 +01:00
committed by GitHub
parent b93d1f9294
commit f2e8d7e9be
3 changed files with 7 additions and 8 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
import type { BigString, DiscordChannel, DiscordForumTag } from '@discordeno/types'; import type { BigString, DiscordChannel, DiscordForumTag } from '@discordeno/types';
import { calculatePermissions, iconHashToBigInt } from '@discordeno/utils'; import { iconHashToBigInt } from '@discordeno/utils';
import type { Bot } from '../bot.js'; import type { Bot } from '../bot.js';
import type { DesiredPropertiesBehavior, SetupDesiredProps, TransformersDesiredProperties } from '../desiredProperties.js'; import type { DesiredPropertiesBehavior, SetupDesiredProps, TransformersDesiredProperties } from '../desiredProperties.js';
import { ChannelToggles } from './toggles/channel.js'; import { ChannelToggles } from './toggles/channel.js';
@@ -52,8 +52,8 @@ export const baseChannel: Channel = {
return { return {
type, type,
id, id,
allow: calculatePermissions(allow), allow,
deny: calculatePermissions(deny), deny,
}; };
}) ?? [] }) ?? []
); );
+2 -3
View File
@@ -51,7 +51,6 @@ import type {
MfaLevels, MfaLevels,
OAuth2Scope, OAuth2Scope,
OverwriteTypes, OverwriteTypes,
PermissionStrings,
PremiumTiers, PremiumTiers,
PremiumTypes, PremiumTypes,
PresenceStatus, PresenceStatus,
@@ -517,9 +516,9 @@ export interface Channel {
/** Either 0 (role) or 1 (member) */ /** Either 0 (role) or 1 (member) */
type: OverwriteTypes; type: OverwriteTypes;
/** Permission bit set */ /** Permission bit set */
allow: PermissionStrings[]; allow: bigint;
/** Permission bit set */ /** Permission bit set */
deny: PermissionStrings[]; deny: bigint;
}[]; }[];
} }
+2 -2
View File
@@ -18,9 +18,9 @@ export interface Overwrite {
// NOTE: // NOTE:
// - Discord says that these are always present, we keep them as optional (and allow for null) because when it is sent it can be null / not present, https://discord.com/developers/docs/resources/guild#create-guild-channel-json-params, specificly the ** // - Discord says that these are always present, we keep them as optional (and allow for null) because when it is sent it can be null / not present, https://discord.com/developers/docs/resources/guild#create-guild-channel-json-params, specificly the **
/** Permission bit set */ /** Permission bit set */
allow?: string | null; allow?: BigString | null;
/** Permission bit set */ /** Permission bit set */
deny?: string | null; deny?: BigString | null;
} }
// This needs the prefix Discordeno to avoid conflicts with the @discordeno/bot types. // This needs the prefix Discordeno to avoid conflicts with the @discordeno/bot types.