Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23ebc14b8b | ||
|
|
3a5768a1b1 | ||
|
|
33c3803ca8 | ||
|
|
f3613fb674 | ||
|
|
f1dc8cbcf5 | ||
|
|
a365c4b69f | ||
|
|
687372481a | ||
|
|
1bc8bde922 |
@@ -0,0 +1,37 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve Open Ticket
|
||||
title: "[BUG] your bug"
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Device:**
|
||||
- Device: [e.g. Macbook pro, raspberry pi, HP Probook]
|
||||
- OS: [e.g. MacOS, Ubuntu, Windows,...]
|
||||
- Node.js version:
|
||||
- Open Ticket Version:
|
||||
|
||||
**Files:**
|
||||
Please include the `openticketdebug.txt` file in your report!
|
||||
This is a file that we can see what happend!
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
name: Plugin
|
||||
about: Show your open ticket plugins here!
|
||||
title: "[PLUGIN] your plugin"
|
||||
labels: plugin
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Plugin Name:**
|
||||
What's the name of your plugin?
|
||||
|
||||
**Description:**
|
||||
Tell a little bit about what the plugin does!
|
||||
Also tell how to use the plugin, like if there is additional setup needed!
|
||||
|
||||
**NPM libraries:**
|
||||
List all the libraries needed for this plugin to work!
|
||||
*The default open ticket libraries are not required!*
|
||||
|
||||
**Author:**
|
||||
- github account [e.g. DJj123dj]
|
||||
- discord account [e.g. Wumpus#1234]
|
||||
|
||||
**Compatible versions:**
|
||||
[e.g. from v2.2.1 until v3.0.1]
|
||||
|
||||
**File:**
|
||||
Please attach the plugin file to this issue!
|
||||
@@ -1,5 +1,5 @@
|
||||
# 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!
|
||||
Start using it now, you can do anything!
|
||||
@@ -48,11 +48,11 @@ Start using it now, you can do anything!
|
||||
[Click here to start your adventure!](https://docs.openticket.dj-dj.be/quick-start)
|
||||
|
||||
## documentation
|
||||
[Official Documentation](https://docs.openticket.dj-dj.be)
|
||||
[<img src="./otWIKI.png" width="400px" href="https://docs.openticket.dj-dj.be">](https://docs.openticket.dj-dj.be)
|
||||
|
||||
## information
|
||||
|
||||
_v3.0.0_
|
||||
_v3.0.1_
|
||||
|
||||
changelog: [click here](https://docs.openticket.dj-dj.be/other/changelog)
|
||||
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@
|
||||
"dropdown":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,
|
||||
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
||||
|
||||
@@ -4,7 +4,8 @@ const client = bot.client
|
||||
const config = bot.config
|
||||
const log = bot.errorLog.log
|
||||
const l = bot.language
|
||||
const storage = bot.storage
|
||||
|
||||
const configParser = require("../../utils/configParser")
|
||||
|
||||
|
||||
//EVENT API:
|
||||
@@ -48,7 +49,7 @@ exports.onTicketOpen = (user,channel,guild,date,ticketdata) => {
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||
* @param {String} reason
|
||||
*/
|
||||
exports.onTicketClose = (user,channel,guild,date,ticketdata,reason) => {
|
||||
@@ -69,7 +70,7 @@ exports.onTicketClose = (user,channel,guild,date,ticketdata,reason) => {
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||
*/
|
||||
exports.onTicketDelete = (user,channel,guild,date,ticketdata) => {
|
||||
//system
|
||||
@@ -89,7 +90,7 @@ exports.onTicketDelete = (user,channel,guild,date,ticketdata) => {
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||
*/
|
||||
exports.onTicketReopen = (user,channel,guild,date,ticketdata) => {
|
||||
//system
|
||||
@@ -110,7 +111,7 @@ exports.onTicketReopen = (user,channel,guild,date,ticketdata) => {
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||
*/
|
||||
exports.onTicketAdd = (user,editeduser,channel,guild,date,ticketdata) => {
|
||||
//system
|
||||
@@ -131,7 +132,7 @@ exports.onTicketAdd = (user,editeduser,channel,guild,date,ticketdata) => {
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||
*/
|
||||
exports.onTicketRemove = (user,editeduser,channel,guild,date,ticketdata) => {
|
||||
//system
|
||||
@@ -237,7 +238,7 @@ exports.onCommand = (type,hasPerms,user,channel,guild,date) => {
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -246,7 +247,7 @@ exports.onCommand = (type,hasPerms,user,channel,guild,date) => {
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||
* @param {String} reason
|
||||
*/
|
||||
|
||||
@@ -265,7 +266,7 @@ exports.onCommand = (type,hasPerms,user,channel,guild,date) => {
|
||||
* @param {discord.TextChannel} channel
|
||||
* @param {discord.Guild} guild
|
||||
* @param {Date} date
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:configParser.OTTicketOptions}} ticketdata
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,9 +19,13 @@ module.exports = () => {
|
||||
/**@type {Error} */
|
||||
const theError = err
|
||||
if (api.enableAPIdebug){
|
||||
const data = fs.readFileSync("./apiDebug.txt")
|
||||
const newData = data ? data.toString() : ""
|
||||
fs.writeFileSync("./apiDebug.txt",newData+"ERROR: "+theError.name+": "+theError.message+"\n"+theError.stack+"\n\n")
|
||||
try {
|
||||
const data = fs.readFileSync("./apiDebug.txt")
|
||||
const newData = data ? data.toString() : ""
|
||||
fs.writeFileSync("./apiDebug.txt",newData+"ERROR: "+theError.name+": "+theError.message+"\n"+theError.stack+"\n\n")
|
||||
}catch{
|
||||
fs.writeFileSync("./apiDebug.txt","ERROR: "+theError.name+": "+theError.message+"\n"+theError.stack+"\n\n")
|
||||
}
|
||||
}
|
||||
failcount++
|
||||
totalcount++
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,7 @@ const storage = bot.storage
|
||||
module.exports = () => {
|
||||
//dropdown placeholder
|
||||
client.on("interactionCreate",(interaction) => {
|
||||
if (!interaction.isSelectMenu()) return
|
||||
if (!interaction.isStringSelectMenu()) return
|
||||
if (interaction.customId != "OTdropdownMenu") return
|
||||
if (interaction.values.includes("OTChooseTicket")) interaction.deferUpdate()
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -126,7 +126,11 @@ client.on('ready',async () => {
|
||||
|
||||
log("system","bot logged in!")
|
||||
|
||||
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
||||
try {
|
||||
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
||||
}catch{
|
||||
this.errorLog.log("info","tried to cache user information, failed!")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -163,7 +167,7 @@ client.on('ready',async () => {
|
||||
console.log(chalk.green("switching to slashDisable.js"))
|
||||
require("./core/slashSystem/slashDisable")()
|
||||
}else{
|
||||
console.log(chalk.red("Internal Error: unknown slash mode!"))
|
||||
console.log(chalk.red("[SLASH CMD MANAGER]: unknown slash mode!"))
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
@@ -214,12 +218,14 @@ const debugLog = (debugString) => {
|
||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
||||
fs.writeFileSync("./openticketdebug.txt",content+"\nDEBUG: "+debugString)
|
||||
}
|
||||
this.errorLog.clearDebugFile()
|
||||
}
|
||||
const errorLog = (errorString,stack) => {
|
||||
if (!APIConfig.disable.debug.all){
|
||||
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)
|
||||
}
|
||||
this.errorLog.clearDebugFile()
|
||||
}
|
||||
this.errorLog.log("debug","OT error system loaded successfully")
|
||||
|
||||
|
||||
+21
-21
@@ -3,8 +3,7 @@
|
||||
"missingArgsTitle":"Ungültiges Argument!",
|
||||
"missingArgsDescription":"Fehlendes Argument!",
|
||||
"noPermsTitle":"Du hast keine Rechte!",
|
||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
||||
"noPermsDelete":"Only admins can delete a ticket!",
|
||||
"noPermsDescription":"Sie haben nicht die richtigen Rollen, um diesen Befehl auszuführen!\nSie benötigen die `ADMINISTRATOR` Erlaubnis oder in der Liste der erlaubten Rollen sein!",
|
||||
"chooseFromListTitle":"Ungültige ID",
|
||||
"chooseFromListDescription":"Wählen Sie eine der folgenden ID:",
|
||||
"boterror":"Bot Fehler!",
|
||||
@@ -15,24 +14,30 @@
|
||||
"anotherOption":"Diese Option ist kein Ticket, sondern eine andere Art!",
|
||||
"maxAmountTitle":"Das Limit wurde erreicht!",
|
||||
"maxAmountDescription":"Sie haben die maximal zulässige Anzahl von Tickets erreicht!\nSie können also keine neue erstellen.!",
|
||||
"somethingWentWrong":"**Etwas ist schief gelaufen!**\nBitte versuchen Sie es ein anderes Mal!",
|
||||
"somethingWentWrong":"Etwas ist schief gelaufen!**\nBitte versuchen Sie es ein anderes Mal!",
|
||||
"somethingWentWrongTranscript":"Bei der Erstellung der Transcript ist etwas schief gelaufen!**\nBitte versuchen Sie es ein anderes Mal!"
|
||||
},
|
||||
"commands":{
|
||||
"userAddedTitle":"Added {0} to this ticket!",
|
||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
||||
"renameTitle":"Changed the name to {0}!",
|
||||
"closeTitle":"Closed this ticket!",
|
||||
"deleteTitle":"Deleting this ticket...",
|
||||
"reopenTitle":"Re-Opened this ticket!",
|
||||
"claimTitle":"This ticket is now claimed to {0}",
|
||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
||||
"userAddedTitle":"User geaddet!",
|
||||
"userAddedDescription":"{0} wird zu diesem Ticket hinzugefügt!",
|
||||
"userRemovedTitle":"User entfernt!",
|
||||
"userRemovedDescription":"{0} wird aus diesem Ticket entfernt!",
|
||||
|
||||
"ticketWarning":"The embed is in the message below!",
|
||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
||||
"renameTitle":"Der Name wurde geändert!",
|
||||
"renameWarning":"Achtung: Sie können den Kanalnamen nur 2 Mal pro Minute ändern!\n(dies ist auf die Begrenzung der Diskordrate zurückzuführen)",
|
||||
|
||||
"closeTitle":"Dieses Ticket schließen!",
|
||||
"closeDescription":"Sie können dieses Ticket schließen, indem Sie auf die Schaltfläche unten klicken!",
|
||||
"deleteTitle":"Löschen Sie dieses Ticket!",
|
||||
"deleteDescription":"Sie können dieses Ticket löschen, indem Sie auf die Schaltfläche unten klicken!",
|
||||
"reopenTitle":"Öffne dieses Ticket erneut!",
|
||||
"reopenDescription":"Sie können dieses Ticket erneut öffnen, indem Sie auf die Schaltfläche unten klicken!",
|
||||
|
||||
"ticketWarning":"Die Einbettung befindet sich in der Nachricht unten!",
|
||||
"maxTicketWarning":"**Warnung:** _Sie können nur {0} ticket(s) erstellen zu einer Zeit!_"
|
||||
},
|
||||
"helpMenu":{
|
||||
"title":"Available Commands:",
|
||||
"title":"Hilfe Menu:",
|
||||
"header1":"**Gehe zu {0} um ein Ticket zu erstellen!**\n\n",
|
||||
"header2":"**Führen Sie den Befehl `/new` oder `/ticket` um ein Ticket zu erstellen!**\n\n",
|
||||
|
||||
@@ -64,20 +69,15 @@
|
||||
"deletedTicketDmTitle":"Ticket löschen!",
|
||||
"closedTicketDmDescription":"Ihr Ticket ist geschlossen!",
|
||||
"deletedTicketDmDescription":"Ihr Ticket ist gelöscht!",
|
||||
"reopenTicketDmTitle":"Ticket neu Eröffnen!",
|
||||
"reopenTicketDmDescription":"Dein Ticket ist Neu eröffnet!",
|
||||
"newTranscriptTitle":"Eine neue Transscript finden Sie hier!",
|
||||
"newTranscriptDescription":"Die Abschrift finden Sie in der obigen Textdatei!",
|
||||
"hereIsTheTranscript":"Hier ist das Transscript:",
|
||||
|
||||
"chooseCategory":"Wähle eine Kategorie:",
|
||||
"gettingdeleted":"Ticket wird gelöscht...",
|
||||
|
||||
"none":"none",
|
||||
"reason":"reason",
|
||||
|
||||
"deletedby":"Gelöscht von",
|
||||
"closedby":"Geschlossen von",
|
||||
"modalreason":"Was ist der Grund für das schließen des Tickets?",
|
||||
"modalreason":"Was ist der Grund?",
|
||||
"chooseATicket": "Wähle ein Ticket"
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"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.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@@ -15,7 +15,7 @@
|
||||
"dependencies": {
|
||||
"axios": "^0.27.2",
|
||||
"chalk": "^5.0.1",
|
||||
"discord.js": "^14.0.2",
|
||||
"discord.js": "^14.7.1",
|
||||
"express": "^4.17.1",
|
||||
"node": "^16.10.0",
|
||||
"node-localstorage": "^2.2.1"
|
||||
|
||||
Reference in New Issue
Block a user