1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tuske: Help with eval.

Discussion in 'Skript' started by XxItzMichaelxX, Jan 27, 2019.

Thread Status:
Not open for further replies.
  1. XxItzMichaelxX

    Joined:
    Jan 27, 2019
    Messages:
    1
    Likes Received:
    0
    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 (Text):
    1. discord command evaluate <text>:
    2.     aliases: eval
    3.     prefixes: spn!
    4.     trigger:
    5.         if event-member has permission view audit logs:
    6.             set {_code} to regex replace "^\s+" with "" in arg-1
    7.             if first 3 characters of {_code} is "```":
    8.                 if last 3 characters of {_code} is "```":
    9.                     if first 6 characters of {_code} is "```vbs": # VB.Net syntax highlighting support on code blocks
    10.                         set {_code} to subtext of {_code} from character 7 to (length of {_code} - 3)
    11.                     else:
    12.                         set {_code} to subtext of {_code} from character 4 to (length of {_code} - 3)
    13.                 else:
    14.                     create embed:
    15.                         set description of the embed to ":x: Invalid code block!"
    16.                         set color of the embed to color from rgb 255, 0, 0
    17.                     reply with the last created embed
    18.                     stop
    19.  
    20.             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.
    21.             if {_errors::*} is set:
    22.                 create embed:
    23.                     set title of the embed to ":x: Evaluate Errors (%size of {_errors::*}%)"
    24.                     add field named ":inbox_tray: Input" with value "```vbs%nl%%{_code}%%nl%```" to embed
    25.                     add field named ":outbox_tray: Output" to embed
    26.                     set the color of the embed to red
    27.                     set the thumbnail of embed to "https://cdn.discordapp.com/attachments/523201265405263912/524492930170486784/SpnIcon3.png"
    28.                     set footer of embed to footer with text "Supernatural" and icon "https://cdn.discordapp.com/attachments/523201265405263912/524483277931937802/SpnIcon.png"
    29.                     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"
    30.                     set the timestamp of embed to now
    31.                     loop {_errors::*}:
    32.                         set {_parse::*} to loop-value parsed as "%text% \(TuSKe\/evaluate.sk, line %integer%\: %text%'\)"
    33.                         add field named "Line %{_parse::2}%:" with value "```vbs%nl%%{_parse::1}%%nl%> %{_parse::3}%%nl%```" to embed
    34.                 reply with the last created embed
     

    Attached Files:

Thread Status:
Not open for further replies.

Share This Page

Loading...