cemoji

Simple tag that adds color emojis (cemoji). You can set the shape as either a circle or a square by modifying a single variable in the code. The default shape is circle. Read the comments for help. The first word should be the name you want to give the emoji, and the second word should be the hex code for the color. Usage examples: !cemoji blue 0000FF !cemoji red FF0000

Sharedunrated

Content

34 lines
{=(prefix):!}
{=(tagname):cemoji}

{=(comment):The shape variable below should either be the word "circle" or "square", depending on what shape you want the color emoji to be. No spaces before or after the word.}

{=(shape):circle}

{=(comment):this section creates variables used in a later check to see if the second input in {args} (ie {list(1):{join(~):{args}}}) is a valid hexidecimal color}
{=(hex):{replace(#,):{list(1):{join(~):{args}}}}}
{=(uhex):{upper:{hex}}}
{=(length):{index(%^&):{replace(, ):{uhex}} %^&}}
{=(hex2num):{replace(A,10):{replace(B,11):{replace(C,12):{replace(D,13):{replace(E,14):{replace(F,15):{uhex}}}}}}}}
{=(hextest):{m:trunc({join(+):{replace(, ):{hex2num}}})}}

{=(comment):These are the different error messages}
{=(error1):Reconfigure the {tagname} tag using the dashboard. The shape variable is incorrect. 
Shape must be set to either `circle` or `square` with no spaces.
Shape is currently set to: `{shape}`}
{=(error2):Incorrect command syntax. You must provide a name for the emoji and a hexadecimal color code.
Usage: `{prefix}{tagname} emoji_name hex_code`
Example: `{prefix}{tagname} blue 0000FF`}
{=(error3):`{if(=={hex}): |{hex}}` is not a valid hexadecimal color code. Hexadecimal color codes must have 6 characters between 0-9 or A-F.
Shorthand Hex codes and Alpha values are not supported by this custom command.
See <https://htmlcolorcodes.com/color-picker/> for help finding the Hex code for the color you want.}

{=(comment):this determines if there is an error and sets the number for the error message output}
{=(enum):{if({contains({shape}):circle square}==false):1|{if(=={1}):2|{any({length}!=6|{hextest}!={m:trunc({hextest}/1)}):3|0}}}}

{=(comment):A precautionary blank variable to make sure any double brackets used do not display should the content between them be made null.}
{=():}

{=(comment):the link to the emoji, and the command block that executes the addemoji command. Addemoji requires Manage Server permissions for usage.}
{=(link):https://res.cloudinary.com/demo/w_1024/c_fill{if({shape}==circle):,r_max}/e_colorize,co_rgb:{uhex}/one_pixel.png}
{{if({enum}==0):c:addemoji {1} {link}|error{enum}}}
Raw JSON
{
  "id": 378151,
  "created_at": "2020-10-17T01:16:01.000Z",
  "tag_name": "cemoji",
  "nsfw": false,
  "owner_id": "129419437911572480",
  "uses": 8,
  "description": "Simple tag that adds color emojis (cemoji). You can set the shape as either a circle or a square by modifying a single variable in the code.\nThe default shape is circle. Read the comments for help.\nThe first word should be the name you want to give the emoji, and the second word should be the hex code for the color.\nUsage examples: \n!cemoji blue 0000FF\n!cemoji red FF0000",
  "restricted": false,
  "shared": true,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "632187193162465281",
  "sharer": "129419437911572480",
  "content": "{=(prefix):!}\n{=(tagname):cemoji}\n\n{=(comment):The shape variable below should either be the word \"circle\" or \"square\", depending on what shape you want the color emoji to be. No spaces before or after the word.}\n\n{=(shape):circle}\n\n{=(comment):this section creates variables used in a later check to see if the second input in {args} (ie {list(1):{join(~):{args}}}) is a valid hexidecimal color}\n{=(hex):{replace(#,):{list(1):{join(~):{args}}}}}\n{=(uhex):{upper:{hex}}}\n{=(length):{index(%^&):{replace(, ):{uhex}} %^&}}\n{=(hex2num):{replace(A,10):{replace(B,11):{replace(C,12):{replace(D,13):{replace(E,14):{replace(F,15):{uhex}}}}}}}}\n{=(hextest):{m:trunc({join(+):{replace(, ):{hex2num}}})}}\n\n{=(comment):These are the different error messages}\n{=(error1):Reconfigure the {tagname} tag using the dashboard. The shape variable is incorrect. \nShape must be set to either `circle` or `square` with no spaces.\nShape is currently set to: `{shape}`}\n{=(error2):Incorrect command syntax. You must provide a name for the emoji and a hexadecimal color code.\nUsage: `{prefix}{tagname} emoji_name hex_code`\nExample: `{prefix}{tagname} blue 0000FF`}\n{=(error3):`{if(=={hex}): |{hex}}` is not a valid hexadecimal color code. Hexadecimal color codes must have 6 characters between 0-9 or A-F.\nShorthand Hex codes and Alpha values are not supported by this custom command.\nSee <https://htmlcolorcodes.com/color-picker/> for help finding the Hex code for the color you want.}\n\n{=(comment):this determines if there is an error and sets the number for the error message output}\n{=(enum):{if({contains({shape}):circle square}==false):1|{if(=={1}):2|{any({length}!=6|{hextest}!={m:trunc({hextest}/1)}):3|0}}}}\n\n{=(comment):A precautionary blank variable to make sure any double brackets used do not display should the content between them be made null.}\n{=():}\n\n{=(comment):the link to the emoji, and the command block that executes the addemoji command. Addemoji requires Manage Server permissions for usage.}\n{=(link):https://res.cloudinary.com/demo/w_1024/c_fill{if({shape}==circle):,r_max}/e_colorize,co_rgb:{uhex}/one_pixel.png}\n{{if({enum}==0):c:addemoji {1} {link}|error{enum}}}",
  "embed": "{}",
  "last_fetched": "2026-10-20T22:47:37.260Z"
}