nyx/commands/Moderation/unlock.js

33 lines
1,017 B
JavaScript
Raw Normal View History

2021-06-12 12:53:51 +02:00
const { Client, Message, MessageEmbed } = require("discord.js");
module.exports = {
name: "unlock",
description: "Lock a channel",
UserPerm: "MANAGE_CHANNELS",
BotPerm: "MANAGE_CHANNELS",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
message.channel
.createOverwrite(message.guild.id, { SEND_MESSAGES: true })
.then(() => {
const embed = new MessageEmbed()
.setTitle("Channel Unlocked")
.addField("**Moderator**", message.author.tag, true)
.addField("**Channel**", `<#${message.channel.id}>`, true)
.setFooter(
message.member.displayName || message.author.username,
message.author.displayAvatarURL({ dynamic: true })
)
.setThumbnail(client.user.displayAvatarURL())
.setColor(client.color)
.setTimestamp();
message.inlineReply(embed);
});
},
};