mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Update DJS
This commit is contained in:
parent
ac619ec00f
commit
5e73d380c5
23 changed files with 71 additions and 56 deletions
|
@ -1,3 +1,4 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import * as t from "io-ts";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { canActOn } from "../../../pluginUtils";
|
||||
|
@ -30,6 +31,6 @@ export async function addRoleAction(
|
|||
|
||||
const rolesToAdd = Array.isArray(action.role) ? action.role : [action.role];
|
||||
await target.edit({
|
||||
roles: Array.from(new Set([...target.roles.cache.array(), ...rolesToAdd])),
|
||||
roles: Array.from(new Set([...target.roles.cache.array(), ...rolesToAdd])) as Snowflake[],
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Snowflake, TextChannel } from "discord.js";
|
||||
import { Permissions, Snowflake, TextChannel } from "discord.js";
|
||||
import * as t from "io-ts";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ActionError } from "../ActionError";
|
||||
|
@ -31,9 +31,16 @@ export async function setChannelPermissionOverridesAction(
|
|||
}
|
||||
|
||||
for (const override of action.overrides) {
|
||||
await channel.overwritePermissions(
|
||||
channel.permissionOverwrites.create(
|
||||
override.id as Snowflake,
|
||||
new Permissions(BigInt(override.allow)).add(BigInt(override.deny)).serialize(),
|
||||
);
|
||||
|
||||
/*
|
||||
await channel.permissionOverwrites overwritePermissions(
|
||||
[{ id: override.id, allow: BigInt(override.allow), deny: BigInt(override.deny), type: override.type }],
|
||||
`Custom event: ${event.name}`,
|
||||
);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue