Salagata

REPL in TagScript

Nov 3rd, 2025 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. {if:{text:https://api.jsonblob.com/{getuser:SESSION|0}}|=|{"error":"Blob not found"}|then:{js:
  2. async function createJSON() {
  3. const url = 'https://api.jsonblob.com/'
  4. const data = {
  5. "variables":[],
  6. "attachments":[]
  7. }
  8.  
  9. const respuesta = await fetch(url, {
  10. method: 'POST',
  11. headers: {
  12. 'Content-Type': 'application/json',
  13. 'Accept': 'application/json'
  14. },
  15. body: JSON.stringify(data)
  16. })
  17. discord.storage.user.SESSION = respuesta.headers.get('location').slice(1);
  18. }
  19. createJSON()
  20. }}
  21.  
  22. {set:session|{text:https://api.jsonblob.com/{getuser:SESSION}}}
  23. {eval:{foreach:{traversejson:variables|{get:session}}|{bracketleft}set:{traversejson:name|{get:valuex}}{splitterargument}{traversejson:value|{get:valuex}}{bracketright}}}
  24. {delete:session}
  25. {eval:{replace:(.+?)=(.*)|{ignore:{setuser:SESSION|$1}{if:$2|=||then:|else:{set:_|$2}}$2}|{getuser:SESSION}={eval:{args}}}}
  26.  
  27.  
  28. {js:
  29. let remaining = discord.variables;
  30. console.log(`{"embeds":[{"author":{"icon_url":"{avatar}","name":"{user}#{discrim}","url":"https://discord.com/users/{id}"},"color":${Math.floor(Math.random() * 256**3)},"description":"${(() => {
  31. const cm = discord.variables.__argsString.match(/\{([a-z]+)(?:\:(.+?))?\}/)
  32. switch(cm?.[1]) {
  33. case "help":
  34. return "REPL(Read-Eval-Print Loop) in TagScript\\n-# Developed by <@1005205558497906839>, the kappas @Sanae Kochiya and @Nitori Kawashiro ❤️\\nThis is an REPL, so you must go line by line, all the custom commands are `.tag {tagname} <custom_command>` or `.tag {tagname} <code>` for testcode all the variables will be saved when the code ends to evaluate, so you dont have to define them again\\nHere is a list of commans to use in the REPL\\n**{load:LINK}** loads a file as an attachment for the next sessions\\n**{save}** saves this session into a JSON if you want to load it again\\n**{loadjson:LINK}** loads a JSON to the session (the current session will be overwritten)\\n**{clear}** Reset this session (All the variables and attachments will be *deleted*)\\nMore commands comming soon! (sorry only the help works right now :cry:)";
  35. default:
  36. return "Say .tag {tagname} {help} to see the list of commands for this REPL"
  37.  
  38. }
  39.  
  40. })()}","fields":[{"name":"**Variables**:","value":"${(() => {
  41. for(const k in ({"__files":[],"__iterationsRemaining":10000,"__argsString":"path variables","__args":["path","variables"],"__aiExecutions":0,"__apiManipulations":0,"__networkRequests":0,"__networkRequestsML":0,"__networkRequestsOpenAI":0,"__fileSize":0,"__results":{},"__settings":{},"__tagExecutions":0,"__componentExecutions":0,"__isFromChildParsing":0,"__parentTagId":0})) {
  42. delete remaining[k]
  43. }
  44. let o = ""
  45. for(const k in remaining) {
  46. o += `\\n\\t **${k}**: ${remaining[k].replaceAll("\"","\\\"").replaceAll("\n","\\n")}`
  47. }
  48. if(o == "") {
  49. return "There are no variables…"
  50. }
  51. return o
  52. })()}"}],"footer":{"icon_url":"https://cdn.discordapp.com/attachments/1124758334805909509/1435121392499556404/Th19Sanae.png?ex=690ad073&is=69097ef3&hm=c3cbfadeb6e0830f1046a6e705cdc4058f66e45878d109b66f7c09f08996ad6f&","text":"Sanae Kochiya (exif copycat 2)"},"type":"poor"}]}`)
  53. const v = [];
  54. for(let k in remaining) {
  55. v.push({
  56. "name":k,"value":remaining[k]
  57. })
  58. }
  59.  
  60. const url = 'https://api.jsonblob.com/{getuser:SESSION}'
  61. const data = {
  62. "variables":v,
  63. "attachments":[]
  64. }
  65.  
  66. fetch(url, {
  67. method: 'PUT',
  68. headers: {
  69. 'Content-Type': 'application/json',
  70. 'Accept': 'application/json'
  71. },
  72. body: JSON.stringify(data)
  73. })
  74. }
Advertisement
Add Comment
Please, Sign In to add comment