Skip to content

Commit

Permalink
Lock Ticket Channel Command
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubaid7 authored May 6, 2021
1 parent a71446f commit 4c75e7a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Episode 40/commands/Main-Commands/Ticket/Command/lock.js
Original file line number Diff line number Diff line change
@@ -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`)
}
}
}

0 comments on commit 4c75e7a

Please sign in to comment.