added some new commands
- rename - close - delete
This commit is contained in:
@@ -126,6 +126,36 @@ module.exports = () => {
|
||||
require("./ticketCloser").closeTicket(interaction,prefix,"close")
|
||||
})
|
||||
|
||||
client.on("interactionCreate",interaction => {
|
||||
if (!interaction.isButton()) return
|
||||
if (interaction.customId != "closeTicketTrue1") return
|
||||
|
||||
interaction.deferUpdate()
|
||||
const closedButtonDisabled = new discord.MessageActionRow()
|
||||
.addComponents([
|
||||
new discord.MessageButton()
|
||||
.setCustomId("closeTicketTrue1")
|
||||
.setDisabled(true)
|
||||
.setStyle("SECONDARY")
|
||||
.setEmoji("🔒")
|
||||
])
|
||||
interaction.message.edit({components:[closedButtonDisabled]})
|
||||
|
||||
/**
|
||||
* @type {String}
|
||||
*/
|
||||
const name = interaction.channel.name
|
||||
var prefix = ""
|
||||
const tickets = config.options
|
||||
tickets.forEach((ticket) => {
|
||||
if (name.startsWith(ticket.channelprefix)){
|
||||
prefix = ticket.channelprefix
|
||||
}
|
||||
})
|
||||
|
||||
require("./ticketCloser").closeTicket(interaction,prefix,"close")
|
||||
})
|
||||
|
||||
|
||||
//NORMAL DELETE
|
||||
client.on("interactionCreate",interaction => {
|
||||
|
||||
@@ -13,7 +13,6 @@ module.exports = async () => {
|
||||
var choices = []
|
||||
ids.forEach((id) => {
|
||||
const option = getoptions.getOptionsById(id)
|
||||
console.log(option.id)
|
||||
choices.push({name:option.name,value:option.id})
|
||||
})
|
||||
|
||||
@@ -26,8 +25,8 @@ module.exports = async () => {
|
||||
var readystats = 0
|
||||
|
||||
setInterval(() => {
|
||||
console.log("[status] there are "+chalk.blue(readystats+" out of 8")+" commands ready! (this can take some time)")
|
||||
if (readystats >= 8){
|
||||
console.log("[status] there are "+chalk.blue(readystats+" out of 9")+" commands ready! (this can take some time)")
|
||||
if (readystats >= 9){
|
||||
console.log(chalk.green("ready!"))
|
||||
console.log(chalk.blue("you can now start the bot with 'npm start'!"))
|
||||
process.exit(1)
|
||||
@@ -160,4 +159,22 @@ module.exports = async () => {
|
||||
readystats++
|
||||
})
|
||||
|
||||
//rename
|
||||
client.application.commands.create({
|
||||
name:"rename",
|
||||
description:"Rename this ticket.",
|
||||
defaultPermission:true,
|
||||
type:"CHAT_INPUT",
|
||||
options:[
|
||||
{
|
||||
type:"STRING",
|
||||
name:"name",
|
||||
description:"The new name (without prefix).",
|
||||
required:true
|
||||
}
|
||||
]
|
||||
},sid).then(() => {
|
||||
readystats++
|
||||
})
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user