generated from Baipyrus/DiscordJS-Template
explicit permission overwrites
This commit is contained in:
parent
f5d8bcc449
commit
8e9ddb1e7b
@ -1,6 +1,24 @@
|
||||
import { ChannelType, Events, PermissionsBitField } from 'discord.js';
|
||||
import { ChannelType, Events, PermissionFlagsBits } from 'discord.js';
|
||||
import { VoiceChannel } from '../../database.js';
|
||||
|
||||
const vcPermissionOverwrites = [
|
||||
PermissionFlagsBits.ManageRoles,
|
||||
PermissionFlagsBits.ManageChannels,
|
||||
PermissionFlagsBits.ViewChannel,
|
||||
PermissionFlagsBits.ModerateMembers,
|
||||
PermissionFlagsBits.SendMessages,
|
||||
PermissionFlagsBits.SendMessagesInThreads,
|
||||
PermissionFlagsBits.ManageMessages,
|
||||
PermissionFlagsBits.ReadMessageHistory,
|
||||
PermissionFlagsBits.AddReactions,
|
||||
PermissionFlagsBits.Connect,
|
||||
PermissionFlagsBits.Speak,
|
||||
PermissionFlagsBits.MuteMembers,
|
||||
PermissionFlagsBits.DeafenMembers,
|
||||
PermissionFlagsBits.MoveMembers,
|
||||
PermissionFlagsBits.UseVAD
|
||||
];
|
||||
|
||||
const getchannel = async (member, channels) => {
|
||||
// Check database for existing channel
|
||||
const ownCh = await VoiceChannel.findOne({
|
||||
@ -21,9 +39,7 @@ const getchannel = async (member, channels) => {
|
||||
permissionOverwrites: [
|
||||
{
|
||||
id: member.id,
|
||||
allow: [
|
||||
PermissionsBitField.All
|
||||
]
|
||||
allow: vcPermissionOverwrites
|
||||
}
|
||||
]
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user