Brucord-Xloxn1296

Xloxn’s Eval Code (Modified)

Aug 28th, 2023
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.66 KB | None | 0 0
  1. $nomention
  2. $c[ Whitelisted user ids separated by comma or whatever since I'm using checkContains (because onlyForIDs is lame) ]
  3. $var[ids;$botOwnerID]
  4. $c[ In case change is needed (f.e Slash commands), code for evaluation or miscellaneous that I'm too lazy to mention, it's important ok. ]
  5. $var[message;$message]
  6. $var[color;#2c2d31]
  7.  
  8. $c[ Any feedbacks, be it suggestions or bug reports can be sent to me at: Kaeste#6342 (226492244151107586) ]
  9. $c[ btw, yes the custom icons in the error thumbnails were made by me, if you wanna use them for your own stuff you can contact me (i lik seeing stuff), or just use them without telling me idk, it's not like I'm gonna ask for credit anyways (just don't claim them as your own and I'll be happy). ]
  10.  
  11. $c[ Type "$c[/ce]" anywhere in your code to run the "classic eval" with no fancy stuff because why not amr. ]
  12.  
  13. $if[$checkContains[$var[ids];$authorID]] $c[ <- error message at the bottom of the code ]
  14. $if[$checkContains[$toLowercase[$message];%{DOL}%c[/ce\]]]
  15. $eval[$var[message]]
  16. $else
  17. $try
  18.  
  19.  
  20. $eval[$replaceText[$var[message];$amongus;ඞ]] $c[funny]
  21.  
  22. $async[1]
  23. $replyIn[1s]
  24. $sendEmbedMessage[$channelID;;;;📥 **Input**
  25. ``` $trimSpace[$var[message]]```
  26. 📤 **Output**
  27. ```$if[$trimSpace[$eval[$replaceText[$var[message];$amongus;ඞ]]]==]N/A $else $trimSpace[$eval[$replaceText[$var[message];$amongus;ඞ]]]$endif```;$var[color];;;;;;;no;no]
  28. $endasync
  29.  
  30.  
  31. $catch
  32. $textSplit[$error[message];`]
  33. $var[function;$replaceText[$replaceText[$checkContains[$splitText[2];$];true;$splitText[2]];false;$splitText[4]]]
  34. $if[$checkContains[$var[function];$]==false]
  35. $var[function;$error[command]]
  36. $endif
  37. $c[ for loop/eval stuff ]
  38. $var[functionName;$replaceText[$var[function];$;]]
  39.  
  40. $if[$var[function]!=]
  41. $var[errorMessage;$error[message]]
  42. $httpGet[https://botdesignerdiscord.com/public/api/function/$var[function][\]]
  43. $try$c[$httpResult[tag]]$catch$httpGet[https://botdesignerdiscord.com/public/api/function/$var[function]]$endtry
  44. $var[tag;$httpResult[tag]]
  45. $var[shortDescription;```js
  46. < $httpResult[shortDescription] >
  47. ```]
  48. $else
  49. $var[errorMessage;Error message missing.]
  50. $var[tag;N/A]
  51. $var[shortDescription;```js
  52. < Couldn't find the function that error'ed. >
  53. ```
  54. $if[$checkContains[$var[message];%{DOL}%if[]]( There may be a chance that one of your `%{DOL}%if[\]` function has an invalid condition. [Check the wiki for more info.\](https://nilpointer-software.github.io/bdfd-wiki/guides/ifStatements.html) )$endif]
  55. $endif
  56.  
  57. $c[ ok ]
  58. $var[escapedSource;$replaceText[$replaceText[$replaceText[$replaceText[$var[message];$;%%DOL%%];\;;%%SEMICOL%%];\\];%%ESCCLOSE%%];\[;%%ESCOPEN%%]]
  59. $if[$checkContains[$var[errorMessage];expected]$checkContains[$var[errorMessage];in position]==truetrue]
  60. $var[errorPos;$trimSpace[$textSplit[$var[errorMessage];position]$textSplit[$splitText[2];,]$splitText[1]]]
  61. $var[errorStr;$textSplit[$var[errorMessage];']$textSplit[$splitText[2];']$splitText[1]]
  62. $var[source;$eval[$var[i;0]$replaceText[`$var[escapedSource]`;%%DOL%%$var[functionName][;%{DOL}%var[i%{-SEMICOL-}%%{DOL}%sum[%{DOL}%var[i\]%{-SEMICOL-}%1\]\]%{DOL}%var[r%{-SEMICOL-}%%{DOL}%var[r\].\]%%FUNC_N%%%{DOL}%var[FUNC_%{DOL}%var[i\]%{-SEMICOL-}%]]]
  63. $eval[$var[i;0]$replaceText[$var[r];.;%{DOL}%var[i%{-SEMICOL-}%%{DOL}%sum[%{DOL}%var[i\]%{-SEMICOL-}%1\]\]%{DOL}%textSplit[%{DOL}%var[FUNC_%{DOL}%var[i\]\]%{-SEMICOL-}%%%SEMICOL%%\]
  64. %{DOL}%if[%{DOL}%and[%{DOL}%splitText[%{DOL}%var[errorPos\]\]==%{DOL}%var[errorStr\]%{-SEMICOL-}%%{DOL}%optOff[%{DOL}%getTextSplitLength\]>=%{DOL}%var[errorPos\]\]==true\]
  65. %{DOL}%var[FUNC_%{DOL}%var[i\]%{-SEMICOL-}% `**__`%%DOL%%$var[functionName][%{DOL}%var[FUNC_%{DOL}%var[i\]\]\\]`__**` \]%{DOL}%else
  66. %{DOL}%var[FUNC_%{DOL}%var[i\]%{-SEMICOL-}%%%DOL%%$var[functionName][%{DOL}%var[FUNC_%{DOL}%var[i\]\]\\]\]%{DOL}%endif]]
  67. $var[source;$eval[$var[i;0]$replaceText[$var[source];%%FUNC_N%%;%{DOL}%var[i%{-SEMICOL-}%%{DOL}%sum[%{DOL}%var[i\]%{-SEMICOL-}%1\]\]%{DOL}%var[FUNC_%{DOL}%var[i\]\]]]]
  68. $elseif[$checkContains[$var[errorMessage];expected at least]]
  69. $var[argCount;$trimSpace[$textSplit[$var[errorMessage];least]$textSplit[$splitText[2];arguments]$splitText[1]]] $c[lmao this variable is useless]
  70. $var[argGot;$trimSpace[$textSplit[$var[errorMessage];got]$splitText[2]]]
  71. $var[source;$eval[$var[i;0]$var[r;]$replaceText[`$var[escapedSource]`;%%DOL%%$var[functionName][;%%FUNC_N%%%{DOL}%var[i\;%{DOL}%sum[%{DOL}%var[i\]\;1\]\]%{DOL}%var[r\;%{DOL}%var[r\].\]%{DOL}%var[FUNC_%{DOL}%var[i\]%{-SEMICOL-}%]]]
  72. $eval[$var[i;0]$replaceText[$var[r];.;%{DOL}%var[i\;%{DOL}%sum[%{DOL}%var[i\]\;1\]\]%{DOL}%textSplit[%{DOL}%var[FUNC_%{DOL}%var[i\]\]\;%%SEMICOL%%\]
  73. %{DOL}%if[%{DOL}%optOff[%{DOL}%getTextSplitLength\]==%{DOL}%var[argGot\]\]
  74. %{DOL}%var[FUNC_%{DOL}%var[i\]\; `**__`%%DOL%%$var[functionName][%{DOL}%var[FUNC_%{DOL}%var[i\]\]\\]`__**` \]%{DOL}%else
  75. %{DOL}%var[FUNC_%{DOL}%var[i\]\;%%DOL%%$var[functionName][%{DOL}%var[FUNC_%{DOL}%var[i\]\]\\]\]%{DOL}%endif]]
  76. $var[source;$eval[$var[i;0]$replaceText[$var[source];%%FUNC_N%%;%{DOL}%var[i\;%{DOL}%sum[%{DOL}%var[i\]\;1\]\]%{DOL}%var[FUNC_%{DOL}%var[i\]\]]]]
  77. $elseif[$checkContains[$var[errorMessage];Expected `\]`]]
  78. $var[escapedSource;$replaceText[`$var[escapedSource]`;\];%%BRACKET%%]]
  79. $var[source;$eval[$var[i;0]$var[indexes;]$replaceText[$replaceText[$var[escapedSource];[;%{DOL}%var[i\;%{DOL}%sum[%{DOL}%var[i\]\;1\]\]%{DOL}%var[indexes\;%{DOL}%var[indexes\],%{DOL}%var[i\]\] `**`[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%var[i\]%{-SEMICOL-}%1%{-SEMICOL-}%¹\]%{-SEMICOL-}%2%{-SEMICOL-}%²\]%{-SEMICOL-}%3%{-SEMICOL-}%³\]%{-SEMICOL-}%4%{-SEMICOL-}%⁴\]%{-SEMICOL-}%5%{-SEMICOL-}%⁵\]%{-SEMICOL-}%6%{-SEMICOL-}%⁶\]%{-SEMICOL-}%7%{-SEMICOL-}%⁷\]%{-SEMICOL-}%8%{-SEMICOL-}%⁸\]%{-SEMICOL-}%9%{-SEMICOL-}%⁹\]%{-SEMICOL-}%0%{-SEMICOL-}%⁰\]`**` ];%%BRACKET%%; %{DOL}%optOff[%{DOL}%textSplit[%{DOL}%var[indexes\]\;,\]%{DOL}%trimSpace[%{DOL}%if[%{DOL}%splitText[%{DOL}%getTextSplitLength\]!=\]`**`%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%splitText[%{DOL}%getTextSplitLength\]%{-SEMICOL-}%1%{-SEMICOL-}%¹\]%{-SEMICOL-}%2%{-SEMICOL-}%²\]%{-SEMICOL-}%3%{-SEMICOL-}%³\]%{-SEMICOL-}%4%{-SEMICOL-}%⁴\]%{-SEMICOL-}%5%{-SEMICOL-}%⁵\]%{-SEMICOL-}%6%{-SEMICOL-}%⁶\]%{-SEMICOL-}%7%{-SEMICOL-}%⁷\]%{-SEMICOL-}%8%{-SEMICOL-}%⁸\]%{-SEMICOL-}%9%{-SEMICOL-}%⁹\]%{-SEMICOL-}%0%{-SEMICOL-}%⁰\]%{DOL}%removeSplitTextElement[%{DOL}%getTextSplitLength\]%{DOL}%var[indexes\;%{DOL}%joinSplitText[,\]\]%{DOL}%else `**`⁰%{DOL}%endif\]\]\]`**` ]]]
  80. $var[source;$replaceText[$var[source];%%DOL%%$var[functionName]; `**__`%%DOL%%$var[functionName]`__**` ]]
  81. $var[indexes;$textSplit[$var[indexes];,]$replaceText[$replaceText[$replaceText[$var[indexes];,;;1];,$splitText[$optOff[$getTextSplitLength]]; and $splitText[$getTextSplitLength]];,;, ]]
  82. $footer[$replaceText[$replaceText[$checkContains[$var[indexes];,;and];true;Brackets № $var[indexes] were not closed!];false;Bracket № $var[indexes] was not closed!]]
  83. $elseif[$checkContains[$var[errorMessage];not closed with]]
  84. $var[escapedSource;$replaceText[`$var[escapedSource]`;\];%%BRACKET%%]]
  85. $var[errorFunc;$textSplit[$var[errorMessage];with `$]$textSplit[$splitText[2];`]$splitText[1]]
  86. $var[source;$eval[$var[i;0]$replaceText[$replaceText[$var[escapedSource];%%DOL%%$var[functionName];%{DOL}%var[i\;%{DOL}%sum[%{DOL}%var[i\]\;1\]\]%{DOL}%var[indexes\;%{DOL}%var[indexes\],%{DOL}%var[i\]\]%%FUNC_N%%%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%var[i\]%{-SEMICOL-}%1%{-SEMICOL-}%⁽¹⁾\]%{-SEMICOL-}%2%{-SEMICOL-}%⁽²⁾\]%{-SEMICOL-}%3%{-SEMICOL-}%⁽³⁾\]%{-SEMICOL-}%4%{-SEMICOL-}%⁽⁴⁾\]%{-SEMICOL-}%5%{-SEMICOL-}%⁽⁵⁾\]%{-SEMICOL-}%6%{-SEMICOL-}%⁽⁶⁾\]%{-SEMICOL-}%7%{-SEMICOL-}%⁽⁷⁾\]%{-SEMICOL-}%8%{-SEMICOL-}%⁽⁸⁾\]%{-SEMICOL-}%9%{-SEMICOL-}%⁽⁹⁾\]%{-SEMICOL-}%0%{-SEMICOL-}%⁽⁰⁾\]];%%DOL%%$var[errorFunc];%{DOL}%textSplit[%{DOL}%var[indexes\]\;,\]%{DOL}%optOff[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%splitText[%{DOL}%getTextSplitLength\]%{-SEMICOL-}%1%{-SEMICOL-}%⁽¹⁾\]%{-SEMICOL-}%2%{-SEMICOL-}%⁽²⁾\]%{-SEMICOL-}%3%{-SEMICOL-}%⁽³⁾\]%{-SEMICOL-}%4%{-SEMICOL-}%⁽⁴⁾\]%{-SEMICOL-}%5%{-SEMICOL-}%⁽⁵⁾\]%{-SEMICOL-}%6%{-SEMICOL-}%⁽⁶⁾\]%{-SEMICOL-}%7%{-SEMICOL-}%⁽⁷⁾\]%{-SEMICOL-}%8%{-SEMICOL-}%⁽⁸⁾\]%{-SEMICOL-}%9%{-SEMICOL-}%⁽⁹⁾\]%{-SEMICOL-}%0%{-SEMICOL-}%⁽⁰⁾\]%%DOL%%$var[errorFunc]%{DOL}%removeSplitTextElement[%{DOL}%getTextSplitLength\]%{DOL}%var[indexes\;%{DOL}%joinSplitText[,\]\]\]]]]
  87. $var[source;$replaceText[$eval[$var[i;0]$replaceText[$var[source];%%FUNC_N%%;%{DOL}%var[i\;%{DOL}%sum[%{DOL}%var[i\]\;1\]\]%{DOL}%textSplit[%{DOL}%var[indexes\]\;,\]%{DOL}%optOff[%{DOL}%trimSpace[%{DOL}%if[%{DOL}%getTextSplitIndex[%{DOL}%var[i\]\]!=-1\]`**__`%%DOL%%$var[functionName]`__**`%{DOL}%else %%DOL%%$var[functionName]%{DOL}%endif\]\]]];%%BRACKET%%;\]]]
  88. $var[indexes;$textSplit[$var[indexes];,]$replaceText[$replaceText[$replaceText[$var[indexes];,;;1];,$splitText[$optOff[$getTextSplitLength]]; and $splitText[$getTextSplitLength]];,;, ]]
  89. $footer[$replaceText[$replaceText[$checkContains[$var[indexes];,;and];true;"$var[function]'s" № $var[indexes] were not closed with "$$var[errorFunc]"!];false;"$var[function]" № $var[indexes] was not closed with "$$var[errorFunc]"!]]
  90. $elseif[$checkContains[$var[errorMessage];Failed to find variable]]
  91. $var[errorVarName;$textSplit[$var[errorMessage];named ']$textSplit[$splitText[2];']$splitText[1]]
  92. $var[source;$replaceText[`$var[message]`;$var[function][$var[errorVarName]\]; `**__`$var[function][$var[errorVarName]\]`__**` ]]
  93. $elseif[$checkContains[$var[errorMessage];expects arguments!]]
  94. $var[source;$replaceText[$replaceText[$replaceText[`$var[message]`;$var[function][;%%FUNC_%%];$var[function]; `**__`$var[function]`__**` ];%%FUNC_%%;$var[function][]]
  95. $else
  96. $var[source;`$var[message]`]
  97. $endif
  98. $var[source;$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$var[source];%%DOL%%;$];%%SEMICOL%%;\;];%%ESCCLOSE%%;\\]];%%ESCOPEN%%;\[]; ; ];`**``**`;];**``**;**` `**];``;]]
  99.  
  100. $if[$checkContains[$error[message];HTTP;returned an error]]
  101. $title[HTTP Error]
  102. $color[$var[color]]
  103. $elseif[$checkContains[$error[message];Failed to find variable]]
  104. $title[Variable Not Found]
  105. $color[$var[color]]
  106. $elseif[$or[$checkContains[$error[message];expected at least;got empty value]==true;$cropText[$error[message];8;]==expected]==true]
  107. $title[Invalid Parameters]
  108. $color[$var[color]]
  109. $else
  110. $title[Syntax Error]
  111. $color[$var[color]]
  112. $endif
  113.  
  114. $description[```js
  115. $if[$checkContains[$var[errorMessage];$var[function]]==false]At '$var[function]' $endif$replaceText[$replaceText[$replaceText[$replaceText[$var[errorMessage];```;%%%;1];```;];`;'];%%%;```
  116. ```
  117. ]
  118. ```]
  119. $addField[Function Info:;
  120. $textSplit[$replaceText[$replaceText[$var[tag];$var[function][;];\];];\;]$trimSpace[$if[$var[errorPos]!=]`$var[function][$replaceText[$optOff[$joinSplitText[;]];$splitText[$var[errorPos]];`**__`$splitText[$var[errorPos]]`__**`]\]`$elseif[$checkContains[$var[errorMessage];expected at least]]$textSplit[$replaceText[$var[tag];\];];\;]`$replaceText[$replaceText[$var[tag];\];];$splitText[$var[argGot]];$splitText[$var[argGot]]`**__`]`__**`\]`$elseif[$checkContains[$var[errorMessage];Expected `\]`]]$replaceText[`$var[tag]`;\]`;`**__`\]`__**]$elseif[$checkContains[$var[errorMessage];expects arguments!]]`$var[function]`**__`$replaceText[$var[tag];$var[function];]`__**$else `$var[tag]`$endif]
  121. $var[shortDescription]
  122. $if[$var[functionName]==async][(Wiki "Async" Guide)\](https://nilpointer-software.github.io/bdfd-wiki/guides/async.html)$elseif[$var[functionName]==awaitFunc][(Wiki "Awaited Commands and Functions" Guide)\](https://nilpointer-software.github.io/bdfd-wiki/guides/awaitedCommands.html)$elseif[$checkContains[$var[functionName];Button]][(Wiki "Buttons" Guide)\](https://nilpointer-software.github.io/bdfd-wiki/guides/buttons.html)$elseif[$checkContains[$var[functionName];try;catch;error]][(Wiki "%{DOL}%try, %{DOL}%catch and %{DOL}%error" Guide)\](https://nilpointer-software.github.io/bdfd-wiki/guides/trycatch.html)$elseif[$checkContains[$var[functionName];http]][(Wiki "HTTP Requests" Guide)\](https://nilpointer-software.github.io/bdfd-wiki/guides/httpRequests.html)$elseif[$checkContains[$var[functionName];if;else]][(Wiki "If Statements" Guide)\](https://nilpointer-software.github.io/bdfd-wiki/guides/ifStatements.html)$elseif[$checkContains[$var[functionName];SelectMenu]][(Wiki "Select Menu" Guide)\](https://nilpointer-software.github.io/bdfd-wiki/guides/selectmenu.html)$elseif[$checkContains[$toLowercase[$var[functionName]];split]][(Wiki "Text Splitting" Guide)\](https://nilpointer-software.github.io/bdfd-wiki/guides/textSplitting.html)$elseif[$checkContains[$toLowercase[$var[functionName]];thread]][(Wiki "Threads" Guide)\](https://nilpointer-software.github.io/bdfd-wiki/guides/threads.html)$elseif[$checkContains[$toLowercase[$var[functionName]];var]][(Wiki "Variables" Guide)\](https://nilpointer-software.github.io/bdfd-wiki/guides/variables.html)$elseif[$checkContains[$var[functionName];webhook]][(Wiki "Webhooks" Guide)\](https://nilpointer-software.github.io/bdfd-wiki/guides/webhooks.html)$endif]
  123. $addField[Source Debugging:;
  124. $var[source]]
  125. $endtry
  126. $endif
  127.  
  128. $else
  129. $endif
  130. $endif
Add Comment
Please, Sign In to add comment