3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-25 18:25:03 +00:00

migrate permissions

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
metal 2023-03-11 14:31:59 +00:00 committed by GitHub
parent 8281299369
commit fda9a35f29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 75 additions and 70 deletions

View file

@ -1,4 +1,4 @@
import { Permissions, Snowflake, StageChannel, TextChannel, VoiceChannel } from "discord.js";
import { PermissionsBitField, Snowflake, StageChannel, TextChannel, VoiceChannel } from "discord.js";
import { GuildPluginData } from "knub";
import { LogType } from "../../../data/LogType";
import { isDiscordAPIError, MINUTES } from "../../../utils";
@ -64,7 +64,7 @@ export async function handleCompanionPermissions(
const channel = pluginData.guild.channels.cache.get(channelId as Snowflake);
if (!channel || !(channel instanceof TextChannel)) continue;
pluginData.state.serverLogs.ignoreLog(LogType.CHANNEL_UPDATE, channelId, 3 * 1000);
const fullSerialized = new Permissions(BigInt(permissions)).serialize();
const fullSerialized = new PermissionsBitField(BigInt(permissions)).serialize();
const onlyAllowed = filterObject(fullSerialized, (v) => v === true);
await channel.permissionOverwrites.create(userId, onlyAllowed, {
reason: `Companion Channel for ${voiceChannel!.id} | User Joined`,