mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
Rename permission_overwrites to permissionOverwrites
This commit is contained in:
@@ -105,7 +105,7 @@ export async function createGuildChannel(
|
||||
(await RequestManager.post(endpoints.GUILD_CHANNELS(guild.id), {
|
||||
...options,
|
||||
name,
|
||||
permission_overwrites: options?.permission_overwrites?.map((perm) => ({
|
||||
permission_overwrites: options?.permissionOverwrites?.map((perm) => ({
|
||||
...perm,
|
||||
|
||||
allow: perm.allow.reduce(
|
||||
|
||||
@@ -32,7 +32,7 @@ export async function createChannel(
|
||||
/** The last time when a message was pinned in this channel */
|
||||
lastPinTimestamp,
|
||||
/** The permission overwrites for this channel */
|
||||
permissions: data.permission_overwrites
|
||||
permissionOverwrites: data.permission_overwrites
|
||||
? data.permission_overwrites.map((perm) => ({
|
||||
...perm,
|
||||
allow: calculatePermissions(BigInt(perm.allow)),
|
||||
|
||||
+1
-1
@@ -487,7 +487,7 @@ export interface ChannelCreateOptions {
|
||||
/** The sorting position of the channel */
|
||||
position?: number;
|
||||
/** The channel's permission overwrites */
|
||||
permission_overwrites?: Overwrite[];
|
||||
permissionOverwrites?: Overwrite[];
|
||||
/** The id of the parent category for the channel */
|
||||
parent_id?: string;
|
||||
/** Whether the channel is nsfw */
|
||||
|
||||
@@ -108,7 +108,7 @@ export async function hasChannelPermissions(
|
||||
let everyoneOverwrite: RawOverwrite | undefined;
|
||||
let rolesOverwrites: RawOverwrite[] = [];
|
||||
|
||||
for (const overwrite of channel.permission_overwrites || []) {
|
||||
for (const overwrite of channel.permissionOverwrites || []) {
|
||||
// If the overwrite on this channel is specific to this member
|
||||
if (overwrite.id === memberID) memberOverwrite = overwrite;
|
||||
// If it is the everyone role overwrite
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ Deno.test({
|
||||
async fn() {
|
||||
const channel = cache.channels.get(data.channelID);
|
||||
if (!channel) throw "Channel not found";
|
||||
assertArrayIncludes(channel.permission_overwrites!, [
|
||||
assertArrayIncludes(channel.permissionOverwrites!, [
|
||||
{
|
||||
id: data.roleID,
|
||||
type: OverwriteType.ROLE,
|
||||
|
||||
Reference in New Issue
Block a user