calc
Private
Content
22 lines{=(largs):{lower:{args}}}
{=(COMMENT):This is the part that does the math based on the user input, truncatenates conditionally, puts commas every 3 digits in the result, and replaces the output with an error message when the input was invalid. All of that in that one single line and with no "if" block whatsoever.}
{=(equation):{replace(Z,):{replace(.0Z,):{m:{replace(π,pi):{replace(sqrt,^(1/2)):{replace(÷,/):{replace(x,*):{replace(m,e6):{replace(k,e3):{replace( ,):{largs}}}}}}}}}Z}}}
{=(equation):{replace(<o error>,Error. Invalid input.):{replace(st,):{replace(nd,):{replace(rd,):{replace(th,):{ord:{equation(1):.}}{if({equation(2+):.}!=):.{equation(2+):.}}}}}}}}
{=(COMMENT):Title and thumbnail of the embed.}
{=(title):Calculator}
{=(thumbnail):{replace(1200px,250px):https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/GNOME_Calculator_icon_2018.svg/1200px-GNOME_Calculator_icon_2018.svg.png}}
{=(COMMENT):Conditional input to display. Returns a space when no argument is provided, just so it doesn't display two "`" characters.}
{=(input):{if({1}==):None.|{replace( ,):{largs}}}}
{=(COMMENT):Conditional output to display.}
{=(error):You need to specify an equation to calculate.}
{=(output):{if({1}==):{error}|{equation}}}
{=(COMMENT):Conditional embed's side color. Red if no argument or invalid input; otherwise gray/transparent.}
{=(clr.red):F80E0E}
{=(clr.gray):2f3136}
{=(em.color):{if({1}==):{clr.red}|{if({in(Error. Invalid input.):{equation}}==true):{clr.red}|{clr.gray}}}}
{embed(color):#{em.color}}Embed
1 line{"color": 5198940, "title": "{title}", "fields": [{"name": "Input", "value": "`{input}`", "inline": false}, {"name": "Output", "value": "`{output}`", "inline": false}], "thumbnail": {"url": "{thumbnail}"}}Raw JSON
{
"id": 1302320,
"created_at": "2022-02-25T12:51:15.000Z",
"tag_name": "calc",
"nsfw": false,
"owner_id": "699954666930176001",
"uses": 268,
"description": null,
"restricted": false,
"shared": false,
"deleted": false,
"safe": "",
"hidden": false,
"guild_id": "945389956300435497",
"sharer": "699954666930176001",
"content": "{=(largs):{lower:{args}}}\n\n{=(COMMENT):This is the part that does the math based on the user input, truncatenates conditionally, puts commas every 3 digits in the result, and replaces the output with an error message when the input was invalid. All of that in that one single line and with no \"if\" block whatsoever.}\n{=(equation):{replace(Z,):{replace(.0Z,):{m:{replace(π,pi):{replace(sqrt,^(1/2)):{replace(÷,/):{replace(x,*):{replace(m,e6):{replace(k,e3):{replace( ,):{largs}}}}}}}}}Z}}}\n{=(equation):{replace(<o error>,Error. Invalid input.):{replace(st,):{replace(nd,):{replace(rd,):{replace(th,):{ord:{equation(1):.}}{if({equation(2+):.}!=):.{equation(2+):.}}}}}}}}\n\n{=(COMMENT):Title and thumbnail of the embed.}\n{=(title):Calculator}\n{=(thumbnail):{replace(1200px,250px):https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/GNOME_Calculator_icon_2018.svg/1200px-GNOME_Calculator_icon_2018.svg.png}}\n\n{=(COMMENT):Conditional input to display. Returns a space when no argument is provided, just so it doesn't display two \"`\" characters.}\n{=(input):{if({1}==):None.|{replace( ,):{largs}}}}\n\n{=(COMMENT):Conditional output to display.}\n{=(error):You need to specify an equation to calculate.}\n{=(output):{if({1}==):{error}|{equation}}}\n\n{=(COMMENT):Conditional embed's side color. Red if no argument or invalid input; otherwise gray/transparent.}\n{=(clr.red):F80E0E}\n{=(clr.gray):2f3136}\n{=(em.color):{if({1}==):{clr.red}|{if({in(Error. Invalid input.):{equation}}==true):{clr.red}|{clr.gray}}}}\n{embed(color):#{em.color}}",
"embed": "{\"color\": 5198940, \"title\": \"{title}\", \"fields\": [{\"name\": \"Input\", \"value\": \"`{input}`\", \"inline\": false}, {\"name\": \"Output\", \"value\": \"`{output}`\", \"inline\": false}], \"thumbnail\": {\"url\": \"{thumbnail}\"}}",
"last_fetched": "2026-10-20T18:32:48.158Z"
}