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
+6
View File
@@ -85,6 +85,9 @@ exports.checker = async () => {
/**@param {"userid"|"roleid"|"channelid"|"serverid"} mode @param {String[]} arrayValue @param {String} path */
const checkDiscordArray = (mode,arrayValue,path) => {
if (!Array.isArray(arrayValue)){
return createError("'"+path+"' | this needs to be an Array!")
}
if (mode == "userid"){
arrayValue.forEach((value,index) => {
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
@@ -438,6 +441,9 @@ exports.checker = async () => {
const splitw = w.split("'")
if (splitw.length > 1){
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])}
console.log(splitstring)
})
+14
View File
@@ -93,10 +93,24 @@ exports.custom = (title,message,emoji,color) => {
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 fs = require("fs")
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
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")
}else if (interaction.isButton()){
var customId = interaction.customId
}else if (interaction.isSelectMenu() && (interaction.customId == "OTdropdownMenu")){
}else if (interaction.isStringSelectMenu() && (interaction.customId == "OTdropdownMenu")){
var customId = interaction.values[0]
}else return
@@ -53,7 +53,7 @@ module.exports = () => {
interaction.deferUpdate()
}else if (interaction.isChatInputCommand()){
interaction.reply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)]})
}else if (interaction.isSelectMenu()){
}else if (interaction.isStringSelectMenu()){
await interaction.deferUpdate()
}
+2 -2
View File
@@ -7,10 +7,10 @@ const configParser = require("./configParser")
/**
*
* @param {String[]} ids
* @returns {discord.SelectMenuBuilder|false}
* @returns {discord.StringSelectMenuBuilder|false}
*/
exports.getDropdown = (ids) => {
const dropdown = new discord.SelectMenuBuilder()
const dropdown = new discord.StringSelectMenuBuilder()
.setCustomId("OTdropdownMenu")
.setDisabled(false)
.setMaxValues(1)