Sync Dev Branches

* Fixed bug due to discord.js new components

* Updated all versions to v4.0.3

* #155 : Fixed reply on creation when disabled.

Fixed a bug that caused the bot to send a partial ephemeral message while "replyOnTicketCreation" was disabled.
This commit is contained in:
Jasper
2025-04-28 18:30:43 +02:00
committed by GitHub
parent fd739054fd
commit d404f343e0
44 changed files with 127 additions and 49 deletions
+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.2"})
else newConfig.headers = {"User-Agent":"OpenDiscordBots-OpenTicket/4.0.2"}
if (newConfig.headers) Object.assign(newConfig.headers,{"User-Agent":"OpenDiscordBots-OpenTicket/4.0.3"})
else newConfig.headers = {"User-Agent":"OpenDiscordBots-OpenTicket/4.0.3"}
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.2"})
else newConfig.headers = {"User-Agent":"OpenDiscordBots-OpenTicket/4.0.2"}
if (newConfig.headers) Object.assign(newConfig.headers,{"User-Agent":"OpenDiscordBots-OpenTicket/4.0.3"})
else newConfig.headers = {"User-Agent":"OpenDiscordBots-OpenTicket/4.0.3"}
this.config = newConfig
}
+2
View File
@@ -611,6 +611,7 @@ export class ODButtonResponderInstance {
getMessageComponent(type:"button"|"string-dropdown"|"user-dropdown"|"channel-dropdown"|"role-dropdown"|"mentionable-dropdown", id:string|RegExp): discord.ButtonComponent|discord.StringSelectMenuComponent|discord.RoleSelectMenuComponent|discord.ChannelSelectMenuComponent|discord.MentionableSelectMenuComponent|discord.UserSelectMenuComponent|null {
let result: discord.ButtonComponent|discord.StringSelectMenuComponent|discord.RoleSelectMenuComponent|discord.ChannelSelectMenuComponent|discord.MentionableSelectMenuComponent|discord.UserSelectMenuComponent|null = null
this.message.components.forEach((row) => {
if (row.type != discord.ComponentType.ActionRow) return
row.components.forEach((component) => {
if (type == "button" && component.type == discord.ComponentType.Button && component.customId && ((typeof id == "string") ? component.customId == id : id.test(component.customId))) result = component
else if (type == "string-dropdown" && component.type == discord.ComponentType.StringSelect && component.customId && ((typeof id == "string") ? component.customId == id : id.test(component.customId))) result = component
@@ -898,6 +899,7 @@ export class ODDropdownResponderInstance {
getMessageComponent(type:"button"|"string-dropdown"|"user-dropdown"|"channel-dropdown"|"role-dropdown"|"mentionable-dropdown", id:string|RegExp): discord.ButtonComponent|discord.StringSelectMenuComponent|discord.RoleSelectMenuComponent|discord.ChannelSelectMenuComponent|discord.MentionableSelectMenuComponent|discord.UserSelectMenuComponent|null {
let result: discord.ButtonComponent|discord.StringSelectMenuComponent|discord.RoleSelectMenuComponent|discord.ChannelSelectMenuComponent|discord.MentionableSelectMenuComponent|discord.UserSelectMenuComponent|null = null
this.message.components.forEach((row) => {
if (row.type != discord.ComponentType.ActionRow) return
row.components.forEach((component) => {
if (type == "button" && component.type == discord.ComponentType.Button && component.customId && ((typeof id == "string") ? component.customId == id : id.test(component.customId))) result = component
else if (type == "string-dropdown" && component.type == discord.ComponentType.StringSelect && component.customId && ((typeof id == "string") ? component.customId == id : id.test(component.customId))) result = component