/change bugfix

This commit is contained in:
DJj123dj
2023-02-08 14:27:39 +01:00
parent 5fec028cc9
commit d5b0a0f3c6
6 changed files with 20 additions and 21 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
<img src="https://www.dj-dj.be/wp-content/uploads/2023/02/open-ticket-cropped.png" alt="Open Ticket" width="600px"> <img src="https://www.dj-dj.be/wp-content/uploads/2023/02/open-ticket-cropped.png" alt="Open Ticket" width="600px">
[![discord](https://img.shields.io/badge/discord-join%20our%20server-5865F2.svg?style=flat-square&logo=discord)](https://discord.com/invite/26vT9wt3n3) [![version](https://img.shields.io/badge/version-3.2.1-brightgreen.svg?style=flat-square)](https://github.com/DJj123dj/open-ticket/releases/tag/v3.2.1) [![discord.js](https://img.shields.io/badge/discord.js-v14-CB3837.svg?style=flat-square&logo=npm)]() [![license](https://img.shields.io/badge/license-GPL%203.0-important.svg?style=flat-square)](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE) [![stars](https://img.shields.io/github/stars/djj123dj/open-ticket?color=yellow&label=stars&logo=github&style=flat-square)](https://docs.openticket.dj-dj.be) [![discord](https://img.shields.io/badge/discord-join%20our%20server-5865F2.svg?style=flat-square&logo=discord)](https://discord.com/invite/26vT9wt3n3) [![version](https://img.shields.io/badge/version-3.2.2-brightgreen.svg?style=flat-square)](https://github.com/DJj123dj/open-ticket/releases/tag/v3.2.2) [![discord.js](https://img.shields.io/badge/discord.js-v14-CB3837.svg?style=flat-square&logo=npm)]() [![license](https://img.shields.io/badge/license-GPL%203.0-important.svg?style=flat-square)](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE) [![stars](https://img.shields.io/github/stars/djj123dj/open-ticket?color=yellow&label=stars&logo=github&style=flat-square)](https://docs.openticket.dj-dj.be)
### Open Ticket ### Open Ticket
Open Ticket is of the most customisable discord ticket bots of all time! Open Ticket is of the most customisable discord ticket bots of all time!
@@ -57,7 +57,7 @@ Translators
|Portuguese |*unknown* | |Portuguese |*unknown* |
## links ## links
current version: _v3.2.1_ current version: _v3.2.2_
</br>changelog: [click here](https://docs.openticket.dj-dj.be/other/changelog) </br>changelog: [click here](https://docs.openticket.dj-dj.be/other/changelog)
</br>documentation: [click here](https://docs.openticket.dj-dj.be/quick-start) </br>documentation: [click here](https://docs.openticket.dj-dj.be/quick-start)
+7 -8
View File
@@ -21,7 +21,7 @@ module.exports = () => {
return return
} }
msg.channel.messages.fetchPinned().then(msglist => { msg.channel.messages.fetchPinned().then(async msglist => {
var firstmsg = msglist.last() var firstmsg = msglist.last()
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]}) if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description) const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
@@ -42,9 +42,10 @@ module.exports = () => {
const name = (splitted.length > 0) ? splitted.join("-") : prefix const name = (splitted.length > 0) ? splitted.join("-") : prefix
if (newTicket.category){ if (newTicket.category){
const parent = msg.guild.channels.cache.forEach((ch) => (ch.type == discord.ChannelType.GuildCategory) && ch.id == newTicket.category) const parent = await msg.guild.channels.fetch(newTicket.category,{cache:true})
if (parent) msg.channel.setParent(parent) if (parent && parent.type == discord.ChannelType.GuildCategory) msg.channel.setParent(parent)
} }
msg.channel.setName(newTicket.channelprefix+name) msg.channel.setName(newTicket.channelprefix+name)
msg.channel.send({embeds:[bot.embeds.commands.changeEmbed(msg.author,newtype)]}) msg.channel.send({embeds:[bot.embeds.commands.changeEmbed(msg.author,newtype)]})
@@ -52,8 +53,6 @@ module.exports = () => {
log("system","ticket type changed",[{key:"user",value:msg.author.tag},{key:"ticket",value:name},{key:"newtype",value:newtype}]) log("system","ticket type changed",[{key:"user",value:msg.author.tag},{key:"ticket",value:name},{key:"newtype",value:newtype}])
APIEvents.onCommand("change",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date()) APIEvents.onCommand("change",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
}) })
}) })
if (!DISABLE.commands.slash.change) client.on("interactionCreate",(interaction) => { if (!DISABLE.commands.slash.change) client.on("interactionCreate",(interaction) => {
@@ -67,7 +66,7 @@ module.exports = () => {
} }
//interaction.deferReply() //interaction.deferReply()
interaction.channel.messages.fetchPinned().then(msglist => { interaction.channel.messages.fetchPinned().then(async msglist => {
var firstmsg = msglist.last() var firstmsg = msglist.last()
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]}) if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description) const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
@@ -88,8 +87,8 @@ module.exports = () => {
const name = (splitted.length > 0) ? splitted.join("-") : prefix const name = (splitted.length > 0) ? splitted.join("-") : prefix
if (newTicket.category){ if (newTicket.category){
const parent = interaction.guild.channels.cache.forEach((ch) => (ch.type == discord.ChannelType.GuildCategory) && ch.id == newTicket.category) const parent = await interaction.guild.channels.fetch(newTicket.category,{cache:true})
if (parent) interaction.channel.setParent(parent) if (parent && parent.type == discord.ChannelType.GuildCategory) interaction.channel.setParent(parent)
} }
interaction.channel.setName(newTicket.channelprefix+name) interaction.channel.setName(newTicket.channelprefix+name)
+1 -1
View File
@@ -89,7 +89,7 @@
"dropdown":false, "dropdown":false,
"enableFooter":false, "enableFooter":false,
"footer":"Open Ticket v3.2.1 - I'm a footer!", "footer":"Open Ticket v3.2.2 - I'm a footer!",
"enableThumbnail":false, "enableThumbnail":false,
"thumbnail":"https://www.example.com/catmemes/cat.png", "thumbnail":"https://www.example.com/catmemes/cat.png",
@@ -1,6 +1,6 @@
{ {
"version":"1.0.0", "version":"1.0.0",
"otversion":"3.2.1", "otversion":"3.2.2",
"style":{ "style":{
"enableCustomBackground":false, "enableCustomBackground":false,
"backgroundModus":"color OR image", "backgroundModus":"color OR image",
+8 -8
View File
@@ -70,18 +70,18 @@
"gettingdeleted":"Ticket está sendo deletado...", "gettingdeleted":"Ticket está sendo deletado...",
"none":"none", "none":"none",
"reason":"reason", "reason":"Motivo",
"deletedby":"deleted by", "deletedby":"deleted by",
"closedby":"closed by", "closedby":"closed by",
"modalreason":"What is the reason for closing this ticket?", "modalreason":"Quak o motivo de fechar o ticket?",
"chooseATicket": "Choose a ticket" "chooseATicket": "Fechar Ticket"
}, },
"transcripts":{ "transcripts":{
"title":"Transcript", "title":"Transcrever",
"processed":"This transcript is being processed", "processed":"A Transcrição está em andamento",
"wait":"Please wait!", "wait":"Por favor espere!",
"estimated":"Estimated time", "estimated":"Tempo estimado",
"available":"The transcript is available here" "available":"A Transcrição está disponível aqui"
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "open-ticket", "name": "open-ticket",
"version": "3.2.1", "version": "3.2.2",
"description": "This is an open-source discord ticket bot, you can configure it and it comes with cool features like a transcript.", "description": "This is an open-source discord ticket bot, you can configure it and it comes with cool features like a transcript.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {