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
43 stars 12 forks source link

Embed fields #123

Closed Mushkrem closed 1 year ago

Mushkrem commented 1 year ago

Adds a way to iterate over embed fields:

discord command ?edit:
    trigger:
        set {_ref} to referenced message of event-message

        set {_embed} to first element of embeds of {_ref}
        set {_fields::*} to fields of {_embed}

        make new embed:
            set description of embed to "abc"
            loop {_fields::*}:
                set {_field} to loop-value
                if {_field} is inline:
                    add inline field named (discord name of {_field}) with value "%{_field}%" to fields of embed
                else:
                    add field named (discord name of {_field}) with value "%{_field}%" to fields of embed

        reply with last embed

The add field... effect conflicts with skript's changer, and sadly %embedfield% isn't parsed as a string when used in that effect and has to be parsed manually "%embedfield%".I have no idea how to fix that, other than removing the effect altogether, and just handling the fields as a normal property of embeds that can have something added to them. Well unless you know of a way to solve it;

add field named (discord name of {_field}) with value {_field} to fields of embed

instead of

add field named (discord name of {_field}) with value "%{_field}%" to fields of embed
Mushkrem commented 1 year ago

uh for some reason there are 7 commits, but only 4 files changed