Fixed bug due to discord.js new components
This commit is contained in:
+2
-2
@@ -25,7 +25,7 @@
|
||||
"@discordjs/rest": "^2.4.2",
|
||||
"@types/node": "^22.5.0",
|
||||
"ansis": "^2.3.0",
|
||||
"discord.js": "^14.17.2",
|
||||
"discord.js": "^14.19.1",
|
||||
"formatted-json-stringify": "^1.1.0",
|
||||
"typescript": "^5.5.4"
|
||||
},
|
||||
@@ -42,7 +42,7 @@
|
||||
"#opendiscord": "./dist/src/index.js",
|
||||
"#opendiscord-types": "./dist/src/core/api/api.js"
|
||||
},
|
||||
"funding":{
|
||||
"funding": {
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/DJj123dj"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -257,6 +257,7 @@ export class ODTranscriptCollector {
|
||||
const rows: ODTranscriptComponentRowData[] = []
|
||||
msg.components.forEach((row) => {
|
||||
const components: ODTranscriptComponentRowData["components"] = []
|
||||
if (row.type != discord.ComponentType.ActionRow) return
|
||||
row.components.forEach((component) => {
|
||||
if (component.type == discord.ComponentType.Button){
|
||||
components.push({
|
||||
|
||||
Reference in New Issue
Block a user