>

A quote tag that is made to work with discord's new quote system. You just type a prefix, quote someone's message using the new discord menu option, and Carl-bot will embed it as if they authored it with their name+pfp and role color, a proper embed timestamp, and footer text indicating who is quoting them. It will remove the target mention from either the end of the message (new discord quote syntax) or the beginning of the message (old manual quote syntax, so you can use it like the old quote command too) if the command user mentions a target. While I could have removed target mentions anywhere in the message, if the mention is not in the beginning or end chances are the mention is part of the message itself and removing it would only cause readability problems. Should be useful until Discord implements their rich dynamic version of their quote system.

Sharedunrated

Content

38 lines
{=(footertext):Quoted by: {user(proper)}}
{delete}{embed(timestamp):now}{=():}
{{if({args(1)}==):require(You need to quote something or someone.):carl-bot}}
{=(comment):this attempts to sanitize any linebreaks, quote block GT signs (>) or vertical pipes (|) for the code duration, is undone at the end}
{=(nargs):{replace(|,╬):{replace(
, ╦ ):{replace(
> , ╦ ):{args}}}}}

{=(comment):a leftover from my embedthis tag that does no harm here, just removes an extra space at the beginning if present that would ruin the image grab}
{=(nargs):{if({nargs(1)}==):{nargs(2+)}|{nargs}}}

{=(comment):this adds a space before a user mention, as discord's quote system does not naturally add a space between the mention and the last word in the quote}
{=(nargs):{replace(<@, <@):{nargs}}}

{=(comment):This attempts to replace any superfluous spaces that were in the body of the original message so the image url can be grabbed accurately, as index ignores the spaces but variable parsing does not.}
{=(nargs):{replace(─, ):{join(─):{nargs}}}}

{=(comment):This section finds the image, attempt to make sure it will not cause a json error, then creates a jump link in the description body in place where the image was. only does so for the first image present, and only the first image will be put in the embed display}
{=(imgtest):{replace(., ):{replace(-1.,):{index(.gif):{replace(.gif,. .gif .):{nargs}}}.{index(.png):{replace(.png,. .png .):{nargs}}}.{index(.jpg):{replace(.jpg,. .jpg .):{nargs}}}.{index(.jpeg):{replace(.jpeg,. .jpeg .):{nargs}}}.}}}
{=(imgindex):{if({imgtest(1)}!=):{imgtest(1)}}}
{=(preimg):{nargs({imgindex})}}
{=(imgnoturl):{contains(false):{in(http):{preimg(1)::}} {in(//):{preimg(2)::}}}}
{=(image):{all({imgnoturl}==false|{imgindex(1)}!=):{preimg}}}
{=(nargs):{all({imgnoturl}==false|{imgindex(1)}!=):{if({imgindex}!=1):{nargs(+{m:trunc({imgindex}-1)})} }([image link]({nargs({imgindex})})) {nargs({m:trunc({imgindex}+1)}+)}|{nargs}}}

{=(comment):This section looks to see if there was a target mention at the end or the beginning of the args, and if found, sets the appropriate args parsing such to remove it from the description body}
{=(trgtchk):{if({in({target(id)}):{nargs(0)}}==true):(+-1)|{if({in({target(id)}):{nargs(1)}}==true):(3+)}}}

{=(comment):this sets the entity to target if the target id was found in the first or last arg. otherwise, it sets it to user assuming the target mention in the message body is part of the message}
{=(entity):{if({trgtchk}!=):target|user}}

{=(comment):sets the description to the appropriate parsing of the quote body and "un"sanitizes it}
{=(predes):{if({trgtchk}!=):{nargs{trgtchk}}|{nargs}}}
{=(des):{replace(╦,
):{replace(╬,|):{predes}}}}

{=(comment):sets the embed color to the entity color}
{embed(color):{{entity}(color)}}

Embed

1 line
{"color": 5198940, "image": {"url": "{image}"}, "author": {"name": "{{entity}(proper)}", "icon_url": "{{entity}(avatar)}"}, "footer": {"text": "{footertext}"}, "description": "{des}"}
Raw JSON
{
  "id": 107229,
  "created_at": "2020-01-10T22:33:50.000Z",
  "tag_name": ">",
  "nsfw": false,
  "owner_id": "129419437911572480",
  "uses": 64,
  "description": "A quote tag that is made to work with discord's new quote system. You just type a prefix, quote someone's message using the new discord menu option, and Carl-bot will embed it as if they authored it with their name+pfp and role color, a proper embed timestamp, and footer text indicating who is quoting them. It will remove the target mention from either the end of the message (new discord quote syntax) or the beginning of the message (old manual quote syntax, so you can use it like the old quote command too) if the command user mentions a target. While I could have removed target mentions anywhere in the message, if the mention is not in the beginning or end chances are the mention is part of the message itself and removing it would only cause readability problems. Should be useful until Discord implements their rich dynamic version of their quote system.",
  "restricted": false,
  "shared": true,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "632187193162465281",
  "sharer": "129419437911572480",
  "content": "{=(footertext):Quoted by: {user(proper)}}\n{delete}{embed(timestamp):now}{=():}\n{{if({args(1)}==):require(You need to quote something or someone.):carl-bot}}\n{=(comment):this attempts to sanitize any linebreaks, quote block GT signs (>) or vertical pipes (|) for the code duration, is undone at the end}\n{=(nargs):{replace(|,╬):{replace(\n, ╦ ):{replace(\n> , ╦ ):{args}}}}}\n\n{=(comment):a leftover from my embedthis tag that does no harm here, just removes an extra space at the beginning if present that would ruin the image grab}\n{=(nargs):{if({nargs(1)}==):{nargs(2+)}|{nargs}}}\n\n{=(comment):this adds a space before a user mention, as discord's quote system does not naturally add a space between the mention and the last word in the quote}\n{=(nargs):{replace(<@, <@):{nargs}}}\n\n{=(comment):This attempts to replace any superfluous spaces that were in the body of the original message so the image url can be grabbed accurately, as index ignores the spaces but variable parsing does not.}\n{=(nargs):{replace(─, ):{join(─):{nargs}}}}\n\n{=(comment):This section finds the image, attempt to make sure it will not cause a json error, then creates a jump link in the description body in place where the image was. only does so for the first image present, and only the first image will be put in the embed display}\n{=(imgtest):{replace(., ):{replace(-1.,):{index(.gif):{replace(.gif,. .gif .):{nargs}}}.{index(.png):{replace(.png,. .png .):{nargs}}}.{index(.jpg):{replace(.jpg,. .jpg .):{nargs}}}.{index(.jpeg):{replace(.jpeg,. .jpeg .):{nargs}}}.}}}\n{=(imgindex):{if({imgtest(1)}!=):{imgtest(1)}}}\n{=(preimg):{nargs({imgindex})}}\n{=(imgnoturl):{contains(false):{in(http):{preimg(1)::}} {in(//):{preimg(2)::}}}}\n{=(image):{all({imgnoturl}==false|{imgindex(1)}!=):{preimg}}}\n{=(nargs):{all({imgnoturl}==false|{imgindex(1)}!=):{if({imgindex}!=1):{nargs(+{m:trunc({imgindex}-1)})} }([image link]({nargs({imgindex})})) {nargs({m:trunc({imgindex}+1)}+)}|{nargs}}}\n\n{=(comment):This section looks to see if there was a target mention at the end or the beginning of the args, and if found, sets the appropriate args parsing such to remove it from the description body}\n{=(trgtchk):{if({in({target(id)}):{nargs(0)}}==true):(+-1)|{if({in({target(id)}):{nargs(1)}}==true):(3+)}}}\n\n{=(comment):this sets the entity to target if the target id was found in the first or last arg. otherwise, it sets it to user assuming the target mention in the message body is part of the message}\n{=(entity):{if({trgtchk}!=):target|user}}\n\n{=(comment):sets the description to the appropriate parsing of the quote body and \"un\"sanitizes it}\n{=(predes):{if({trgtchk}!=):{nargs{trgtchk}}|{nargs}}}\n{=(des):{replace(╦,\n):{replace(╬,|):{predes}}}}\n\n{=(comment):sets the embed color to the entity color}\n{embed(color):{{entity}(color)}}",
  "embed": "{\"color\": 5198940, \"image\": {\"url\": \"{image}\"}, \"author\": {\"name\": \"{{entity}(proper)}\", \"icon_url\": \"{{entity}(avatar)}\"}, \"footer\": {\"text\": \"{footertext}\"}, \"description\": \"{des}\"}",
  "last_fetched": "2026-10-20T20:51:44.497Z"
}