From 4c75e7a539e2ed51b65a55136bca96bd7cc87c05 Mon Sep 17 00:00:00 2001 From: Ubaid7 <75165174+Ubaid7@users.noreply.github.com> Date: Thu, 6 May 2021 17:06:09 +0300 Subject: [PATCH] Lock Ticket Channel Command --- .../Main-Commands/Ticket/Command/lock.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Episode 40/commands/Main-Commands/Ticket/Command/lock.js diff --git a/Episode 40/commands/Main-Commands/Ticket/Command/lock.js b/Episode 40/commands/Main-Commands/Ticket/Command/lock.js new file mode 100644 index 0000000..e040bdf --- /dev/null +++ b/Episode 40/commands/Main-Commands/Ticket/Command/lock.js @@ -0,0 +1,20 @@ +const db = require('quick.db') // npm i quick.db + +module.exports = { + commands: ['lock-ticket'], // You Can Keep Any Name + permissions: 'MANAGE_CHANNELS', // You Can Keep Any Permission + permissionError: 'You Cant Use This COmmand', // Optional + description: 'Lock Ticket', // Optional + + callback: (message, args) => { + + if(message.channel.name.includes('ticket')) return // If Channel Isn't Ticket Channel, Won't Work + else { + const memberinticket = db.fetch(`ticket-user_${message.channel.id}`) // Get User In Ticket + message.channel.updateOverwrite(memberinticket, { + SEND_MESSAGES: false + }) // Permission + message.channel.send(`Locked Ticket`) + } + } +}