DiSkyOrg / DiSky

The best Skript add-on for Discord management! Slash commands, interaction, components, modal and much more available!
https://disky.me/
Apache License 2.0
42 stars 12 forks source link

Edit buttons in embed message #175

Closed RoVaSte closed 4 months ago

RoVaSte commented 4 months ago

I am currently trying to edit an button in embed message but it works only if I add a "reply" line, also with this error:

[23:10:22 INFO]: [!] DiSky Internal Error (version: 4.12.2-beta1)
[23:10:22 INFO]: [!] Error type: ErrorResponseException
[23:10:22 INFO]: [!] 
[23:10:22 INFO]: [!] 10015: Unknown Webhook
[23:10:22 INFO]: [!] 
[23:10:22 INFO]: [!] Full Stacktrace:
[23:10:22 INFO]: [!] 
[23:10:22 INFO]: [!] DiSky 4.12.2-beta1.jar//net.dv8tion.jda.api.exceptions.ErrorResponseException.create(ErrorResponseException.java:185)
[23:10:22 INFO]: [!] DiSky 4.12.2-beta1.jar//net.dv8tion.jda.api.requests.Request.onFailure(Request.java:145)
[23:10:22 INFO]: [!] DiSky 4.12.2-beta1.jar//net.dv8tion.jda.internal.requests.RestActionImpl.handleResponse(RestActionImpl.java:281)
[23:10:22 INFO]: [!] DiSky 4.12.2-beta1.jar//net.dv8tion.jda.api.requests.Request.handleResponse(Request.java:293)
[23:10:22 INFO]: [!] DiSky 4.12.2-beta1.jar//net.dv8tion.jda.internal.requests.Requester$WorkTask.handleResponse(Requester.java:423)
[23:10:22 INFO]: [!] DiSky 4.12.2-beta1.jar//net.dv8tion.jda.internal.requests.Requester$WorkTask.access$300(Requester.java:359)
[23:10:22 INFO]: [!] DiSky 4.12.2-beta1.jar//net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:233)
[23:10:22 INFO]: [!] DiSky 4.12.2-beta1.jar//net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:145)
[23:10:22 INFO]: [!] DiSky 4.12.2-beta1.jar//net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:128)
[23:10:22 INFO]: [!] DiSky 4.12.2-beta1.jar//net.dv8tion.jda.internal.requests.Requester$WorkTask.execute(Requester.java:387)
[23:10:22 INFO]: [!] DiSky 4.12.2-beta1.jar//net.dv8tion.jda.api.requests.SequentialRestRateLimiter$Bucket.execute(SequentialRestRateLimiter.java:477)
[23:10:22 INFO]: [!] DiSky 4.12.2-beta1.jar//net.dv8tion.jda.api.requests.SequentialRestRateLimiter$Bucket.run(SequentialRestRateLimiter.java:517)
[23:10:22 INFO]: [!] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[23:10:22 INFO]: [!] java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[23:10:22 INFO]: [!] java.base/java.lang.Thread.run(Thread.java:840)
[23:10:22 INFO]: [!] 
[23:10:22 INFO]: [!] READ THE ERROR CAREFULLY, and if you are sure about it,
[23:10:22 INFO]: [!] you can report the error with the whole stacktrace on the GitHub repository:
[23:10:22 INFO]: [!] https://github.com/DiSkyOrg/DiSky/issues/new
[23:10:22 INFO]: [!] 
[23:10:22 INFO]: [!]

THE CODE:

if discord id of event-button is "btn-2":
        pause track in event-guild
        reply with "." and store it in {_mesajul}
        set {_miau} to event-message
        create a new message and store it in {_msg}:
            make embed:
                set title of embed to "Now playing"
                set description of embed to "[%{_track}%](%track url of {_track}%) [%mention tag of event-member%]"
                set embed color of embed to hex "f54263"
            add last embed to the embeds of the message

            make new component row and store it in {_row}:
                add new secondary button with id "btn-1" named "" with reaction "track_next" to components of the row builder
                add new secondary button with id "btn-5" named "" with reaction "arrow_forward" to components of the row builder
                add new secondary button with id "btn-3" named "" with reaction "repeat" to components of the row builder
                add new danger button with id "btn-4" named "" with reaction "stop_button" to components of the row builder
            add {_row} to rows of the message
        edit {_miau} to show {_msg}
        destroy {_mesajul}
ItsTheSky commented 4 months ago

This should be fixed in 4.14.2, with the rework of the edit effect related with interactions.