openticket v3.0.1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# Open Ticket
|
# Open Ticket
|
||||||
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v3.0.0) []() [](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE) [](https://docs.openticket.dj-dj.be)
|
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v3.0.1) []() [](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE) [](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
@@ -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",
|
||||||
|
|||||||
@@ -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)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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
@@ -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": {
|
||||||
|
|||||||
Reference in New Issue
Block a user