mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
fix channel perm overwrite type
This commit is contained in:
@@ -11,7 +11,6 @@ import type {
|
|||||||
} from "../types/channel.ts";
|
} from "../types/channel.ts";
|
||||||
import type { RawOverwrite } from "../types/guild.ts";
|
import type { RawOverwrite } from "../types/guild.ts";
|
||||||
|
|
||||||
import { logYellow } from "../utils/logger.ts";
|
|
||||||
import { endpoints } from "../constants/discord.ts";
|
import { endpoints } from "../constants/discord.ts";
|
||||||
import { RequestManager } from "../module/requestManager.ts";
|
import { RequestManager } from "../module/requestManager.ts";
|
||||||
import { Errors } from "../types/errors.ts";
|
import { Errors } from "../types/errors.ts";
|
||||||
@@ -189,7 +188,7 @@ export function deleteMessages(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ids.length > 100) {
|
if (ids.length > 100) {
|
||||||
logYellow(
|
console.warn(
|
||||||
`This endpoint only accepts a maximum of 100 messages. Deleting the first 100 message ids provided.`,
|
`This endpoint only accepts a maximum of 100 messages. Deleting the first 100 message ids provided.`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -326,11 +325,11 @@ export function editChannel(
|
|||||||
allow: overwrite.allow.reduce(
|
allow: overwrite.allow.reduce(
|
||||||
(bits, perm) => bits |= BigInt(Permissions[perm]),
|
(bits, perm) => bits |= BigInt(Permissions[perm]),
|
||||||
BigInt(0),
|
BigInt(0),
|
||||||
),
|
).toString(),
|
||||||
deny: overwrite.deny.reduce(
|
deny: overwrite.deny.reduce(
|
||||||
(bits, perm) => bits |= BigInt(Permissions[perm]),
|
(bits, perm) => bits |= BigInt(Permissions[perm]),
|
||||||
BigInt(0),
|
BigInt(0),
|
||||||
),
|
).toString(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
+7
-2
@@ -450,18 +450,23 @@ export interface Overwrite {
|
|||||||
/** The role or user id */
|
/** The role or user id */
|
||||||
id: string;
|
id: string;
|
||||||
/** Whether this is a role or a member */
|
/** Whether this is a role or a member */
|
||||||
type: "role" | "member";
|
type: OverwriteType;
|
||||||
/** The permissions that this id is allowed to do. (This will mark it as a green check.) */
|
/** The permissions that this id is allowed to do. (This will mark it as a green check.) */
|
||||||
allow: Permission[];
|
allow: Permission[];
|
||||||
/** The permissions that this id is NOT allowed to do. (This will mark it as a red x.) */
|
/** The permissions that this id is NOT allowed to do. (This will mark it as a red x.) */
|
||||||
deny: Permission[];
|
deny: Permission[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum OverwriteType {
|
||||||
|
ROLE,
|
||||||
|
MEMBER,
|
||||||
|
}
|
||||||
|
|
||||||
export interface RawOverwrite {
|
export interface RawOverwrite {
|
||||||
/** The role or user id */
|
/** The role or user id */
|
||||||
id: string;
|
id: string;
|
||||||
/** Whether this is a role or a member */
|
/** Whether this is a role or a member */
|
||||||
type: "role" | "member";
|
type: OverwriteType;
|
||||||
/** The permissions that this id is allowed to do. (This will mark it as a green check.) */
|
/** The permissions that this id is allowed to do. (This will mark it as a green check.) */
|
||||||
allow: number;
|
allow: number;
|
||||||
/** The permissions that this id is NOT allowed to do. (This will mark it as a red x.) */
|
/** The permissions that this id is NOT allowed to do. (This will mark it as a red x.) */
|
||||||
|
|||||||
Reference in New Issue
Block a user