mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-21 02:40:08 +00:00
fix(bot): use bigint instead of PermissionStrings[] for allow and deny in channel.permissionOverwrites to match Overwrite type (#4736)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
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 { DesiredPropertiesBehavior, SetupDesiredProps, TransformersDesiredProperties } from '../desiredProperties.js';
|
||||
import { ChannelToggles } from './toggles/channel.js';
|
||||
@@ -52,8 +52,8 @@ export const baseChannel: Channel = {
|
||||
return {
|
||||
type,
|
||||
id,
|
||||
allow: calculatePermissions(allow),
|
||||
deny: calculatePermissions(deny),
|
||||
allow,
|
||||
deny,
|
||||
};
|
||||
}) ?? []
|
||||
);
|
||||
|
||||
@@ -51,7 +51,6 @@ import type {
|
||||
MfaLevels,
|
||||
OAuth2Scope,
|
||||
OverwriteTypes,
|
||||
PermissionStrings,
|
||||
PremiumTiers,
|
||||
PremiumTypes,
|
||||
PresenceStatus,
|
||||
@@ -517,9 +516,9 @@ export interface Channel {
|
||||
/** Either 0 (role) or 1 (member) */
|
||||
type: OverwriteTypes;
|
||||
/** Permission bit set */
|
||||
allow: PermissionStrings[];
|
||||
allow: bigint;
|
||||
/** Permission bit set */
|
||||
deny: PermissionStrings[];
|
||||
deny: bigint;
|
||||
}[];
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ export interface Overwrite {
|
||||
// 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 **
|
||||
/** Permission bit set */
|
||||
allow?: string | null;
|
||||
allow?: BigString | null;
|
||||
/** Permission bit set */
|
||||
deny?: string | null;
|
||||
deny?: BigString | null;
|
||||
}
|
||||
|
||||
// This needs the prefix Discordeno to avoid conflicts with the @discordeno/bot types.
|
||||
|
||||
Reference in New Issue
Block a user