Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
- const channel = require("../../Schemas.js/jointocreatechannels");
- const system = require("../../Schemas.js/jointocreate");
- module.exports = {
- data: new SlashCommandBuilder()
- .setName("vc-unlock")
- .setDescription("Lock your voice channel"),
- async execute (interaction, client) {
- const data = await channel.findOne({ Guild: interaction.guild.id, User: interaction.user.id});
- const sys = await system.findOne({ Guild: interaction.guild.id});
- if (!sys) {
- return await interaction.reply({ content: "This **[GUILD/SERVER]** doesnt have a join to create system!", ephemeral: true});
- } else if (!data) {
- return await interaction.reply({ content: "You dont have a valid voice channel in this **[GUILD/SERVER]**!", ephemeral: true});
- } else if (data) {
- const channelID = data.Channel;
- const channel = await interaction.guild.channels.cache.get(`${channelID}`);
- await channel.edit({
- userLimit: 99,
- })
- await interaction.reply({
- content: "Your voice channel has been unlocked!",
- ephemeral: true
- })
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment