mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-23 01:25:02 +00:00
fix customEvents channel perms overwrites
This commit is contained in:
parent
7f2731262d
commit
655a05b98e
1 changed files with 11 additions and 4 deletions
|
@ -32,10 +32,17 @@ export async function setChannelPermissionOverridesAction(
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const override of action.overrides) {
|
for (const override of action.overrides) {
|
||||||
channel.permissionOverwrites.create(
|
const allow = new Permissions(BigInt(override.allow)).serialize();
|
||||||
override.id as Snowflake,
|
const deny = new Permissions(BigInt(override.deny)).serialize();
|
||||||
new Permissions(BigInt(override.allow)).remove(BigInt(override.deny)).serialize(),
|
const perms = {};
|
||||||
);
|
for (const key in allow) {
|
||||||
|
if (allow[key]) {
|
||||||
|
perms[key] = true;
|
||||||
|
} else if (deny[key]) {
|
||||||
|
perms[key] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
channel.permissionOverwrites.create(override.id as Snowflake, perms);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
await channel.permissionOverwrites overwritePermissions(
|
await channel.permissionOverwrites overwritePermissions(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue