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), {
|
(await RequestManager.post(endpoints.GUILD_CHANNELS(guild.id), {
|
||||||
...options,
|
...options,
|
||||||
name,
|
name,
|
||||||
permission_overwrites: options?.permission_overwrites?.map((perm) => ({
|
permission_overwrites: options?.permissionOverwrites?.map((perm) => ({
|
||||||
...perm,
|
...perm,
|
||||||
|
|
||||||
allow: perm.allow.reduce(
|
allow: perm.allow.reduce(
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export async function createChannel(
|
|||||||
/** The last time when a message was pinned in this channel */
|
/** The last time when a message was pinned in this channel */
|
||||||
lastPinTimestamp,
|
lastPinTimestamp,
|
||||||
/** The permission overwrites for this channel */
|
/** The permission overwrites for this channel */
|
||||||
permissions: data.permission_overwrites
|
permissionOverwrites: data.permission_overwrites
|
||||||
? data.permission_overwrites.map((perm) => ({
|
? data.permission_overwrites.map((perm) => ({
|
||||||
...perm,
|
...perm,
|
||||||
allow: calculatePermissions(BigInt(perm.allow)),
|
allow: calculatePermissions(BigInt(perm.allow)),
|
||||||
|
|||||||
+1
-1
@@ -487,7 +487,7 @@ export interface ChannelCreateOptions {
|
|||||||
/** The sorting position of the channel */
|
/** The sorting position of the channel */
|
||||||
position?: number;
|
position?: number;
|
||||||
/** The channel's permission overwrites */
|
/** The channel's permission overwrites */
|
||||||
permission_overwrites?: Overwrite[];
|
permissionOverwrites?: Overwrite[];
|
||||||
/** The id of the parent category for the channel */
|
/** The id of the parent category for the channel */
|
||||||
parent_id?: string;
|
parent_id?: string;
|
||||||
/** Whether the channel is nsfw */
|
/** Whether the channel is nsfw */
|
||||||
|
|||||||
@@ -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.permission_overwrites || []) {
|
for (const overwrite of channel.permissionOverwrites || []) {
|
||||||
// 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
|
||||||
|
|||||||
+1
-1
@@ -156,7 +156,7 @@ Deno.test({
|
|||||||
async fn() {
|
async fn() {
|
||||||
const channel = cache.channels.get(data.channelID);
|
const channel = cache.channels.get(data.channelID);
|
||||||
if (!channel) throw "Channel not found";
|
if (!channel) throw "Channel not found";
|
||||||
assertArrayIncludes(channel.permission_overwrites!, [
|
assertArrayIncludes(channel.permissionOverwrites!, [
|
||||||
{
|
{
|
||||||
id: data.roleID,
|
id: data.roleID,
|
||||||
type: OverwriteType.ROLE,
|
type: OverwriteType.ROLE,
|
||||||
|
|||||||
Reference in New Issue
Block a user