Synced Dev Branches

Sync Dev Branches
This commit is contained in:
Jasper
2025-04-13 21:11:40 +02:00
committed by GitHub
48 changed files with 668 additions and 128 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ export const registerActions = async () => {
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-claimed",user.id,1,"increase")
//update category
if (params.allowCategoryChange){
if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){
const rawClaimCategory = ticket.option.get("opendiscord:channel-categories-claimed").value.find((c) => c.user == user.id)
const claimCategory = (rawClaimCategory) ? rawClaimCategory.category : null
if (claimCategory){
+1 -1
View File
@@ -28,7 +28,7 @@ export const registerActions = async () => {
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-closed",user.id,1,"increase")
//update category
if (params.allowCategoryChange){
if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){
const closeCategory = ticket.option.get("opendiscord:channel-category-closed").value
if (closeCategory !== ""){
try {
+1 -1
View File
@@ -28,7 +28,7 @@ export const registerActions = async () => {
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-reopened",user.id,1,"increase")
//update category
if (params.allowCategoryChange){
if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){
const channelCategory = ticket.option.get("opendiscord:channel-category").value
const channelBackupCategory = ticket.option.get("opendiscord:channel-category-backup").value
if (channelCategory !== ""){
+1 -1
View File
@@ -22,7 +22,7 @@ export const registerActions = async () => {
ticket.get("opendiscord:busy").value = true
//update category
if (params.allowCategoryChange){
if (typeof params.allowCategoryChange == "boolean" ? params.allowCategoryChange : true){
const channelCategory = ticket.option.get("opendiscord:channel-category").value
const channelBackupCategory = ticket.option.get("opendiscord:channel-category-backup").value
if (channelCategory !== ""){
+2 -2
View File
@@ -604,8 +604,8 @@ const ticketEmbeds = () => {
instance.setFields(embedOptions.fields)
}
if (ticket.get("opendiscord:closed").value && ticket.get("opendiscord:autodelete-enabled").value) instance.setFooter("⏱️ "+lang.getTranslationWithParams("actions.descriptions.ticketMessageAutodelete",[ticket.option.get("opendiscord:autodelete-days").value.toString()]))
else if (!ticket.get("opendiscord:closed").value && ticket.get("opendiscord:autoclose-enabled").value) instance.setFooter("⏱️ "+lang.getTranslationWithParams("actions.descriptions.ticketMessageAutoclose",[ticket.option.get("opendiscord:autoclose-hours").value.toString()]))
if (ticket.get("opendiscord:closed").value && ticket.get("opendiscord:autodelete-enabled").value) instance.setFooter("⏱️ "+lang.getTranslationWithParams("actions.descriptions.ticketMessageAutodelete",[ticket.get("opendiscord:autodelete-days").value.toString()]))
else if (!ticket.get("opendiscord:closed").value && ticket.get("opendiscord:autoclose-enabled").value) instance.setFooter("⏱️ "+lang.getTranslationWithParams("actions.descriptions.ticketMessageAutoclose",[ticket.get("opendiscord:autoclose-hours").value.toString()]))
if (ticket.get("opendiscord:claimed").value){
const claimUser = await opendiscord.tickets.getTicketUser(ticket,"claimer")
+1
View File
@@ -471,6 +471,7 @@ export interface ODLanguageManagerIds_Default {
"opendiscord:norwegian":ODLanguage,
"opendiscord:russian":ODLanguage,
"opendiscord:swedish":ODLanguage,
"opendiscord:vietnamese":ODLanguage,
//ADD NEW LANGUAGES HERE!!!
}
+1 -1
View File
@@ -130,7 +130,7 @@ export class ODMain {
constructor(){
this.versions = new ODVersionManager_Default()
this.versions.add(ODVersion.fromString("opendiscord:version","v4.0.1"))
this.versions.add(ODVersion.fromString("opendiscord:version","v4.0.2"))
this.versions.add(ODVersion.fromString("opendiscord:api","v1.0.0"))
this.versions.add(ODVersion.fromString("opendiscord:transcripts","v2.0.0"))
this.versions.add(ODVersion.fromString("opendiscord:livestatus","v2.0.0"))
+4 -4
View File
@@ -648,8 +648,8 @@ export class ODHTTPGetRequest {
this.throwOnError = throwOnError
const newConfig = config ?? {}
newConfig.method = "GET"
if (newConfig.headers) Object.assign(newConfig.headers,{"User-Agent":"OpenDiscordBots-OpenTicket/4.0.1"})
else newConfig.headers = {"User-Agent":"OpenDiscordBots-OpenTicket/4.0.1"}
if (newConfig.headers) Object.assign(newConfig.headers,{"User-Agent":"OpenDiscordBots-OpenTicket/4.0.2"})
else newConfig.headers = {"User-Agent":"OpenDiscordBots-OpenTicket/4.0.2"}
this.config = newConfig
}
@@ -703,8 +703,8 @@ export class ODHTTPPostRequest {
this.throwOnError = throwOnError
const newConfig = config ?? {}
newConfig.method = "POST"
if (newConfig.headers) Object.assign(newConfig.headers,{"User-Agent":"OpenDiscordBots-OpenTicket/4.0.1"})
else newConfig.headers = {"User-Agent":"OpenDiscordBots-OpenTicket/4.0.1"}
if (newConfig.headers) Object.assign(newConfig.headers,{"User-Agent":"OpenDiscordBots-OpenTicket/4.0.2"})
else newConfig.headers = {"User-Agent":"OpenDiscordBots-OpenTicket/4.0.2"}
this.config = newConfig
}
+3 -3
View File
@@ -298,7 +298,7 @@ export const defaultOptionsStructure = new api.ODCheckerArrayStructure("opendisc
//TICKET
{name:"ticket",priority:0,properties:[{key:"type",value:"ticket"}],checker:new api.ODCheckerObjectStructure("opendiscord:ticket",{cliDisplayKeyInParentArray:"name",cliDisplayAdditionalKeysInParentArray:["id","type"],children:[
{key:"id",optional:false,priority:0,checker:new api.ODCheckerCustomStructure_UniqueId("opendiscord:ticket-id","openticket","option-ids",{regex:/^[A-Za-z0-9-éèçàêâôûî]+$/,minLength:3,maxLength:40})},
{key:"name",optional:false,priority:0,checker:new api.ODCheckerStringStructure("opendiscord:ticket-name",{minLength:2,maxLength:50})},
{key:"name",optional:false,priority:0,checker:new api.ODCheckerStringStructure("opendiscord:ticket-name",{minLength:2,maxLength:45})},
{key:"description",optional:false,priority:0,checker:new api.ODCheckerStringStructure("opendiscord:ticket-description",{maxLength:256})},
//TICKET BUTTON
@@ -382,7 +382,7 @@ export const defaultOptionsStructure = new api.ODCheckerArrayStructure("opendisc
//WEBSITE
{name:"website",priority:0,properties:[{key:"type",value:"website"}],checker:new api.ODCheckerObjectStructure("opendiscord:options-website",{cliDisplayKeyInParentArray:"name",cliDisplayAdditionalKeysInParentArray:["id","type"],children:[
{key:"id",optional:false,priority:0,checker:new api.ODCheckerCustomStructure_UniqueId("opendiscord:website-id","openticket","option-ids",{regex:/^[A-Za-z0-9-éèçàêâôûî]+$/,minLength:3,maxLength:40})},
{key:"name",optional:false,priority:0,checker:new api.ODCheckerStringStructure("opendiscord:website-name",{minLength:2,maxLength:50})},
{key:"name",optional:false,priority:0,checker:new api.ODCheckerStringStructure("opendiscord:website-name",{minLength:2,maxLength:45})},
{key:"description",optional:false,priority:0,checker:new api.ODCheckerStringStructure("opendiscord:website-description",{maxLength:256})},
//WEBSITE BUTTON
@@ -407,7 +407,7 @@ export const defaultOptionsStructure = new api.ODCheckerArrayStructure("opendisc
//REACTION ROLES
{name:"role",priority:0,properties:[{key:"type",value:"role"}],checker:new api.ODCheckerObjectStructure("opendiscord:options-role",{cliDisplayKeyInParentArray:"name",cliDisplayAdditionalKeysInParentArray:["id","type"],children:[
{key:"id",optional:false,priority:0,checker:new api.ODCheckerCustomStructure_UniqueId("opendiscord:role-id","openticket","option-ids",{regex:/^[A-Za-z0-9-éèçàêâôûî]+$/,minLength:3,maxLength:40})},
{key:"name",optional:false,priority:0,checker:new api.ODCheckerStringStructure("opendiscord:role-name",{minLength:2,maxLength:50})},
{key:"name",optional:false,priority:0,checker:new api.ODCheckerStringStructure("opendiscord:role-name",{minLength:2,maxLength:45})},
{key:"description",optional:false,priority:0,checker:new api.ODCheckerStringStructure("opendiscord:role-description",{maxLength:256})},
//ROLE BUTTON
+1
View File
@@ -29,6 +29,7 @@ export const loadAllLanguages = async () => {
opendiscord.languages.add(new api.ODJsonLanguage("opendiscord:norwegian","norwegian.json"))
opendiscord.languages.add(new api.ODJsonLanguage("opendiscord:russian","russian.json"))
opendiscord.languages.add(new api.ODJsonLanguage("opendiscord:swedish","swedish.json"))
opendiscord.languages.add(new api.ODJsonLanguage("opendiscord:vietnamese","vietnamese.json"))
/** How to add more languages?
* - Register the language to the manager (see above)
+1 -1
View File
@@ -20,7 +20,7 @@
INFORMATION:
============
Open Ticket v4.0.1 - © DJdj Development
Open Ticket v4.0.2 - © DJdj Development
support us: https://github.com/sponsors/DJj123dj
discord: https://discord.dj-dj.be