languages/config improvements & bug fixes

This commit is contained in:
DJj123dj
2024-10-02 17:36:08 +02:00
parent 28f0d974e5
commit 6a8a8dd34d
31 changed files with 197 additions and 64 deletions
+6 -6
View File
@@ -135,9 +135,9 @@ export const loadDatabaseCleanersCode = async () => {
//OPTION DATABASE CLEANER
openticket.code.add(new api.ODCode("openticket:option-database-cleaner",10,() => {
//delete all unused options
openticket.options.getAll().forEach((option) => {
if (optionDatabase.exists("openticket:used-option",option.id.value) && !openticket.tickets.getAll().some((ticket) => ticket.option.id.value == option.id.value)){
optionDatabase.delete("openticket:used-option",option.id.value)
openticket.options.forEach((option,id) => {
if (optionDatabase.exists("openticket:used-option",id.value) && !openticket.tickets.getAll().some((ticket) => ticket.id.value == id.value)){
optionDatabase.delete("openticket:used-option",id.value)
}
})
}))
@@ -331,9 +331,9 @@ export const loadDatabaseSaversCode = async () => {
}
//delete all unused options on ticket move
openticket.options.getAll().forEach((option) => {
if (optionDatabase.exists("openticket:used-option",option.id.value) && !openticket.tickets.getAll().some((ticket) => ticket.option.id.value == option.id.value)){
optionDatabase.delete("openticket:used-option",option.id.value)
openticket.options.forEach((option,id) => {
if (optionDatabase.exists("openticket:used-option",id.value) && !openticket.tickets.getAll().some((ticket) => ticket.id.value == id.value)){
optionDatabase.delete("openticket:used-option",id.value)
}
})
})
+1 -1
View File
@@ -1,7 +1,7 @@
import {openticket, api, utilities} from "../../index"
export const loadAllCooldowns = async () => {
openticket.options.getAll().forEach((option) => {
openticket.options.forEach((option) => {
if (!(option instanceof api.ODTicketOption)) return
loadTicketOptionCooldown(option)
})
+2 -2
View File
@@ -2,8 +2,8 @@ import {openticket, api, utilities} from "../../index"
export const loadAllFlags = async () => {
openticket.flags.add(new api.ODFlag("openticket:no-migration","No Migration","Disable Open Ticket data migration on update!","--no-migration",["-nm"]))
openticket.flags.add(new api.ODFlag("openticket:dev-config","Developer Config","Use the configs in /devconfig instead of /config!","--dev-config",["-dc"]))
openticket.flags.add(new api.ODFlag("openticket:dev-database","Developer Database","Use the databases in /devdatabase instead of /database!","--dev-database",["-nd"]))
openticket.flags.add(new api.ODFlag("openticket:dev-config","Developer Config","Use the configs in /devconfig/ instead of /config/!","--dev-config",["-dc"]))
openticket.flags.add(new api.ODFlag("openticket:dev-database","Developer Database","Use the databases in /devdatabase/ instead of /database/!","--dev-database",["-nd"]))
openticket.flags.add(new api.ODFlag("openticket:debug","Debug Mode","Couldn't you find the error? Try to check this out!","--debug",["-d"]))
openticket.flags.add(new api.ODFlag("openticket:crash","Crash On Error","Crash the bot on an unknown error!","--crash",["-cr"]))
openticket.flags.add(new api.ODFlag("openticket:no-transcripts","No HTML Transcripts","Disable uploading HTML transcripts (for debugging)","--no-transcripts",["-nt"]))
+1 -1
View File
@@ -30,7 +30,7 @@ export const loadAllPermissions = async () => {
})
//TICKET ADMINS
openticket.tickets.getAll().forEach(async (ticket) => {
openticket.tickets.forEach(async (ticket) => {
try {
const channel = await openticket.client.fetchGuildTextChannel(mainServer,ticket.id.value)
if (!channel) return