mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +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 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,
|
||||||
};
|
};
|
||||||
}) ?? []
|
}) ?? []
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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;
|
||||||
}[];
|
}[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user