openticket v3.0.1

This commit is contained in:
DJj123dj
2022-12-10 12:59:44 +01:00
parent f3613fb674
commit 33c3803ca8
8 changed files with 30 additions and 8 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
# Open Ticket # Open Ticket
[![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.0.0-brightgreen.svg?style=flat-square)](https://github.com/DJj123dj/open-ticket/releases/tag/v3.0.0) [![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) [![documentation](https://img.shields.io/badge/documentation-Click%20Here-yellow.svg?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.0.1-brightgreen.svg?style=flat-square)](https://github.com/DJj123dj/open-ticket/releases/tag/v3.0.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) [![documentation](https://img.shields.io/badge/documentation-Click%20Here-yellow.svg?style=flat-square)](https://docs.openticket.dj-dj.be)
Open ticket is the most configurable open-source ticket bot for discord! Made with the newest technologies. Like: Slash commands, transcripts, multiple ticket types, buttons & dropdowns! Open ticket is the most configurable open-source ticket bot for discord! Made with the newest technologies. Like: Slash commands, transcripts, multiple ticket types, buttons & dropdowns!
Start using it now, you can do anything! Start using it now, you can do anything!
@@ -52,7 +52,7 @@ Start using it now, you can do anything!
## information ## information
_v3.0.0_ _v3.0.1_
changelog: [click here](https://docs.openticket.dj-dj.be/other/changelog) changelog: [click here](https://docs.openticket.dj-dj.be/other/changelog)
+1 -1
View File
@@ -92,7 +92,7 @@
"dropdown":false, "dropdown":false,
"enableFooter":false, "enableFooter":false,
"footer":"Open Ticket v3.0.0 - I'm a footer!", "footer":"Open Ticket v3.0.1 - I'm a footer!",
"enableThumbnail":false, "enableThumbnail":false,
"thumbnail":"https://www.example.com/catmemes/cat.png", "thumbnail":"https://www.example.com/catmemes/cat.png",
+6
View File
@@ -85,6 +85,9 @@ exports.checker = async () => {
/**@param {"userid"|"roleid"|"channelid"|"serverid"} mode @param {String[]} arrayValue @param {String} path */ /**@param {"userid"|"roleid"|"channelid"|"serverid"} mode @param {String[]} arrayValue @param {String} path */
const checkDiscordArray = (mode,arrayValue,path) => { const checkDiscordArray = (mode,arrayValue,path) => {
if (!Array.isArray(arrayValue)){
return createError("'"+path+"' | this needs to be an Array!")
}
if (mode == "userid"){ if (mode == "userid"){
arrayValue.forEach((value,index) => { arrayValue.forEach((value,index) => {
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){ if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
@@ -438,6 +441,9 @@ exports.checker = async () => {
const splitw = w.split("'") const splitw = w.split("'")
if (splitw.length > 1){ if (splitw.length > 1){
var splitstring = chalk.yellow(splitw[0])+chalk.blue("'"+splitw[1]+"'")+chalk.yellow(splitw[2]) var splitstring = chalk.yellow(splitw[0])+chalk.blue("'"+splitw[1]+"'")+chalk.yellow(splitw[2])
if (splitw[3]){splitstring = splitstring+chalk.yellow(splitw[3])}
if (splitw[4]){splitstring = splitstring+chalk.yellow(splitw[4])}
if (splitw[5]){splitstring = splitstring+chalk.yellow(splitw[5])}
}else {var splitstring = chalk.yellow(splitw[0])} }else {var splitstring = chalk.yellow(splitw[0])}
console.log(splitstring) console.log(splitstring)
}) })
+14
View File
@@ -93,10 +93,24 @@ exports.custom = (title,message,emoji,color) => {
return x return x
} }
exports.clearDebugFile = () => {
const fs = require("fs")
if (!fs.existsSync("./openticketdebug.txt")) return
const content = fs.readFileSync("./openticketdebug.txt").toString().split("\n")
if (content.length < 5000) return
for (let i = 0; i < 4000; i++) {
content.shift()
}
const newContent = "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="+content.join("\n")
fs.writeFileSync("./openticketdebug.txt",newContent)
}
const normalLog = (debugString) => { const normalLog = (debugString) => {
const fs = require("fs") const fs = require("fs")
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n==========================" const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
fs.writeFileSync("./openticketdebug.txt",content+"\nSYSTEM: "+debugString) fs.writeFileSync("./openticketdebug.txt",content+"\nSYSTEM: "+debugString)
this.clearDebugFile()
} }
/** /**
+2 -2
View File
@@ -26,7 +26,7 @@ module.exports = () => {
var customId = "OTnewT"+interaction.options.getString("type") var customId = "OTnewT"+interaction.options.getString("type")
}else if (interaction.isButton()){ }else if (interaction.isButton()){
var customId = interaction.customId var customId = interaction.customId
}else if (interaction.isSelectMenu() && (interaction.customId == "OTdropdownMenu")){ }else if (interaction.isStringSelectMenu() && (interaction.customId == "OTdropdownMenu")){
var customId = interaction.values[0] var customId = interaction.values[0]
}else return }else return
@@ -53,7 +53,7 @@ module.exports = () => {
interaction.deferUpdate() interaction.deferUpdate()
}else if (interaction.isChatInputCommand()){ }else if (interaction.isChatInputCommand()){
interaction.reply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)]}) interaction.reply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)]})
}else if (interaction.isSelectMenu()){ }else if (interaction.isStringSelectMenu()){
await interaction.deferUpdate() await interaction.deferUpdate()
} }
+2 -2
View File
@@ -7,10 +7,10 @@ const configParser = require("./configParser")
/** /**
* *
* @param {String[]} ids * @param {String[]} ids
* @returns {discord.SelectMenuBuilder|false} * @returns {discord.StringSelectMenuBuilder|false}
*/ */
exports.getDropdown = (ids) => { exports.getDropdown = (ids) => {
const dropdown = new discord.SelectMenuBuilder() const dropdown = new discord.StringSelectMenuBuilder()
.setCustomId("OTdropdownMenu") .setCustomId("OTdropdownMenu")
.setDisabled(false) .setDisabled(false)
.setMaxValues(1) .setMaxValues(1)
+2
View File
@@ -218,12 +218,14 @@ const debugLog = (debugString) => {
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n==========================" const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
fs.writeFileSync("./openticketdebug.txt",content+"\nDEBUG: "+debugString) fs.writeFileSync("./openticketdebug.txt",content+"\nDEBUG: "+debugString)
} }
this.errorLog.clearDebugFile()
} }
const errorLog = (errorString,stack) => { const errorLog = (errorString,stack) => {
if (!APIConfig.disable.debug.all){ if (!APIConfig.disable.debug.all){
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n==========================" const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
fs.writeFileSync("./openticketdebug.txt",content+"\nERROR: "+errorString+" STACK: "+stack) fs.writeFileSync("./openticketdebug.txt",content+"\nERROR: "+errorString+" STACK: "+stack)
} }
this.errorLog.clearDebugFile()
} }
this.errorLog.log("debug","OT error system loaded successfully") this.errorLog.log("debug","OT error system loaded successfully")
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "open-ticket", "name": "open-ticket",
"version": "3.0.0", "version": "3.0.1",
"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": {