mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
Add _rawPermissionOverwrites property to Channel
This commit is contained in:
@@ -14,6 +14,7 @@ export async function createChannel(
|
|||||||
rate_limit_per_user: rateLimitPerUser,
|
rate_limit_per_user: rateLimitPerUser,
|
||||||
parent_id: parentID,
|
parent_id: parentID,
|
||||||
last_pin_timestamp: lastPinTimestamp,
|
last_pin_timestamp: lastPinTimestamp,
|
||||||
|
permission_overwrites,
|
||||||
...rest
|
...rest
|
||||||
} = data;
|
} = data;
|
||||||
|
|
||||||
@@ -43,6 +44,8 @@ export async function createChannel(
|
|||||||
nsfw: data.nsfw || false,
|
nsfw: data.nsfw || false,
|
||||||
/** The mention of the channel */
|
/** The mention of the channel */
|
||||||
mention: `<#${data.id}>`,
|
mention: `<#${data.id}>`,
|
||||||
|
/** Raw permissions */
|
||||||
|
_rawPermissionOverwrites: permission_overwrites,
|
||||||
};
|
};
|
||||||
|
|
||||||
cacheHandlers.set("channels", data.id, channel);
|
cacheHandlers.set("channels", data.id, channel);
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export async function hasChannelPermissions(
|
|||||||
let everyoneOverwrite: RawOverwrite | undefined;
|
let everyoneOverwrite: RawOverwrite | undefined;
|
||||||
let rolesOverwrites: RawOverwrite[] = [];
|
let rolesOverwrites: RawOverwrite[] = [];
|
||||||
|
|
||||||
for (const overwrite of channel.permissionOverwrites || []) {
|
for (const overwrite of channel._rawPermissionOverwrites || []) {
|
||||||
// If the overwrite on this channel is specific to this member
|
// If the overwrite on this channel is specific to this member
|
||||||
if (overwrite.id === memberID) memberOverwrite = overwrite;
|
if (overwrite.id === memberID) memberOverwrite = overwrite;
|
||||||
// If it is the everyone role overwrite
|
// If it is the everyone role overwrite
|
||||||
|
|||||||
Reference in New Issue
Block a user