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:
parent
8281299369
commit
fda9a35f29
23 changed files with 75 additions and 70 deletions
|
@ -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`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue