Tuske: Help with eval.

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Jan 27, 2019
1
0
0
20
Hello, my discord eval command works, but is there any way for me to change the message of the evaluation like it just sends the result of the eval. I would like to make a custom message that has the result of the eval in it. The attached images is how I want it. Here is my code.
Code:
discord command evaluate <text>:
    aliases: eval
    prefixes: spn!
    trigger:
        if event-member has permission view audit logs:
            set {_code} to regex replace "^\s+" with "" in arg-1
            if first 3 characters of {_code} is "```":
                if last 3 characters of {_code} is "```":
                    if first 6 characters of {_code} is "```vbs": # VB.Net syntax highlighting support on code blocks
                        set {_code} to subtext of {_code} from character 7 to (length of {_code} - 3)
                    else:
                        set {_code} to subtext of {_code} from character 4 to (length of {_code} - 3)
                else:
                    create embed:
                        set description of the embed to ":x: Invalid code block!"
                        set color of the embed to color from rgb 255, 0, 0
                    reply with the last created embed
                    stop

            evaluate logging in {_errors::*}: {_code}    #<----- this just sends the result, and I would like to make a custom message that has the result in it.
            if {_errors::*} is set:
                create embed:
                    set title of the embed to ":x: Evaluate Errors (%size of {_errors::*}%)"
                    add field named ":inbox_tray: Input" with value "```vbs%nl%%{_code}%%nl%```" to embed
                    add field named ":outbox_tray: Output" to embed
                    set the color of the embed to red
                    set the thumbnail of embed to "https://cdn.discordapp.com/attachments/523201265405263912/524492930170486784/SpnIcon3.png"
                    set footer of embed to footer with text "Supernatural" and icon "https://cdn.discordapp.com/attachments/523201265405263912/524483277931937802/SpnIcon.png"
                    set the author info of the embed to author named "Bot made by: XxItzMichael2xX" with no url and icon "https://cdn.discordapp.com/attachments/523201265405263912/524483277931937802/SpnIcon.png"
                    set the timestamp of embed to now
                    loop {_errors::*}:
                        set {_parse::*} to loop-value parsed as "%text% \(TuSKe\/evaluate.sk, line %integer%\: %text%'\)"
                        add field named "Line %{_parse::2}%:" with value "```vbs%nl%%{_parse::1}%%nl%> %{_parse::3}%%nl%```" to embed
                reply with the last created embed
 

Attachments

  • Screen Shot 2019-01-27 at 2.37.49 PM.png
    Screen Shot 2019-01-27 at 2.37.49 PM.png
    25.7 KB · Views: 358
  • Screen Shot 2019-01-27 at 2.43.45 PM.png
    Screen Shot 2019-01-27 at 2.43.45 PM.png
    72.7 KB · Views: 309
Status
Not open for further replies.