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`) + } + } +}