erg

Privateunrated

Content

123 lines
{=(COMMENT):─── COMMAND CONFIGURATION ───}
{=(COMMENT):Daily reset time (24-hour clock). Format `HH:MM` MUST be respected.}
{=(time.reset):00:00}
{=(COMMENT):Timezone Management. Set "timezone.offset" to 0 if it should return UTC date.
This corresponds to the amount of hours there is between your personal timezone and UTC.}
{=(timezone.offset):-8}

{=(COMMENT):This is the main prefix for Carl-bot on your server. It will be displayed in the embed's footer with the command usage.}
{=(prefix):!}
{=(COMMENT):Make sure you don't name your tag "reset", as it's already a built-in command. Possible alternatives are "dreset" or "dres" or "res", but can be anything else, as long as it doesn't conflict with an existing command.}
{=(tag.name):erg}

{=(COMMENT):───────────────────────────────────
There should be nothing to touch below. Only do it if you know what you're doing.}

{=(COMMENT):Returns the datetime values **in your own timezone** of today and of the reset, in case you want to display them somewhere.}
{=(hour.in.second):3600}
{=(timezone.today.unix):{m:trunc(({timezone.offset}*{hour.in.second})+{unix})}}
{=(timezone.today.datetime):{strf({timezone.today.unix}):%F %T}}

{=(COMMENT):Today's date and time.}
{=(today.date):{strf({timezone.today.unix}):%F}}
{=(today.time):{strf({timezone.today.unix}):%T}}
{=(today.datetime):{today.date} {today.time}}
{=(today.unix):{timezone.today.unix}}

{=(COMMENT):Tomorrow's date and time.}
{=(seconds.in.day):86400}
{=(one.more.day):{strf({m:trunc({seconds.in.day}+{today.unix})}):%F}}
{=(tomorrow.date):{one.more.day}}
{=(tomorrow.datetime):{tomorrow.date} {today.time}}

{=(COMMENT):Checking the sign (positive or negative) of the difference between today's date and the reset date.}
{=(unix.reset):{strf({today.date} {time.reset}:00):%s}}
{=(unix.diff):{m:trunc({today.unix}-{unix.reset})}}
{=(diff.sgn):{m:sgn({unix.diff})}}

{=(COMMENT):If it is positive, it means the reset has already happened today and it should take tomorrow's datetime; otherwise today's datetime.}
{=(reset.to.take):{if({diff.sgn}==1):{tomorrow.date}|{today.date}} {time.reset}:00}
{=(reset.datetime):{reset.to.take}}
{=(reset.unix):{strf({reset.datetime}):%s}}

{=(COMMENT):Actual time remaining between now and the next daily reset!}
{=(time.remaining):{td({timezone.today.datetime}):{reset.datetime}}}

{=(duration):{replace(%2C,):{urlencode:{replace(second,s):{replace(seconds,s):{replace(minute,m):{replace(minutes,m):{replace(hour,h):{replace(hours,h):{replace(and,):{join():{time.remaining}}}}}}}}}}}}



{=(COMMENT):Role IDs listed below}
{=(captainid):769666765172768850}
{=(coxid):769669093262884945}
{=(roleidz):782845539225305089,782845753302843422,782845811645349919,782864308685242368}
{=(yesRole):782845539225305089}
{=(excusedRole):782845753302843422}
{=(noRole):782845811645349919}
{=(otherRole):782864308685242368}
{=(myID):709387130723368968}
{=(logChannel):783553194369613864}
{=(assignedRole):{if({1}==yes):{list(0):{roleidz}}|{if({1}==excused):{list(1):{roleidz}}|{if({1}==no):{list(2):{roleidz}}|{if({1}==other):{list(3):{roleidz}}|{if({1}==help):}}}}}}

{=(commandBlock):c:temprole {target(id)} {duration} {assignedRole}}
{=(targNotUser):{target(id)}!={user(id)}}
{=():}

{=(colorIfBlocks):{if({targNotUser}):{if({1}==yes):#4B8B3B|{if({1}==excused):#010203|{if({1}==no):#FF0000|{if({1}==other):#0504aa}}}}|{if({1}==help):#FFA500|{if({1}==):#FFFF33|#FFFF33}}}}
{=(titleIfBlocks):{any({1}==yes|{1}==excused|{1}==no|{1}==other):{if({targNotUser}):Workout Logging|Uh oh! Mention Error}|{if({1}==help):Command Examples and Definitions|Workout Status Error}}}
{=(footerIfBlocks):{any({1}==yes|{1}==excused|{1}==no|{1}==other):{if({targNotUser}):All roles regarding workout completion reset at midnight tonight.|{if({1}==help):Note: The field explaining the completion status can be left blank and the command will still run.|If you need help with this command, please run `!erg help {1}`}}}}
{=(rdIfBlock):{any({1}==yes|{1}==excused|{1}==no|{1}==other):{if({targNotUser}):{logChannel}}|{channel(id)}}}
{=(reactuEmote):{any({1}==yes|{1}==excused|{1}==no|{1}==other):{if({targNotUser}):✅|❌}|{if({1}==help):✅⬇|⬇}}}
{=(urlIfBlock):{if({1}==help):{if({2}==yes):https://i.imgur.com/8HJhbxy.png|{if({2}==excused):https://i.imgur.com/DnZqWMX.png|{if({2}==no):https://i.imgur.com/I66faZy.png|{if({2}==other):https://i.imgur.com/tCkCfyj.png}}}}}}
{=(nameIfBlock):{if({1}==help):{user(proper)}}}
{=(iconIfBlock):{if({1}==help):{user(avatar)}}}
{=(properOutput):{if({args(3+)}!=):**Notes:** {args(3+)}|}

Approved by: {mention}}
{=(badOutput):{mention} Your argument was correct, *however* you __**cannot**__ approve your own workouts. Please ask a coxswain or another team leader to do it for you}

{require(Only coxswains and captains can use this command!):{coxid},{captainid}}

{=(arg1):{lower:{1}}}
{=({arg1}):Your input did not match one of the available workout statuses. Please type `!erg help` if you need help}


{=(COMMENT):switch outputs below}
{=(yes):{if({targNotUser}):{target(mention)} has **COMPLETED** today's workout and received <@&{yesRole}>.
{properOutput}|{badOutput}}}
{=(excused):{if({target(id)}!={user(id)}):{target(mention)} has been **EXCUSED** from today's workout and received <@&{excusedRole}>.
{properOutput}|{badOutput}}}
{=(no):{if({target(id)}!={user(id)}):{target(mention)} has been marked **UNEXCUSED** from today's workout and received <@&{noRole}>.
{properOutput}|{badOutput}}}
{=(other):{if({target(id)}!={user(id)}):{target(mention)} has **COMPLETED** a different version of today's workout and received <@&{otherRole}>.
{properOutput}|{badOutput}}}
{=(help):{mention} please read the following and if you still need help, ask <@{myID}>.
`!erg yes <@{user(proper)}> did erg but not run`
This example will say you did the erg workout and not the run

`!erg excused <@{user(proper)}> had homework`
This example will say you had homework, thus being excused from the erg

`!erg no <@{user(proper)}> no communication`
This example says you didn't communicate why you were absent Today

`!erg other <@{user(proper)}> did 30 minute bike and 200 jumpies`
This example says you were working out, just not doing Secors workout

`!erg help`
This will output the block you're reading right now

__Note:__ <@{user(proper)}> is equivalent to a ping, so just type "@{user(name)}" then click enter (or the name on your screen) to get the ping
__**Your ping is:**__ {mention}

> If you have any other suggestions for this command, let <@{myID}> know what you are thinking and he might add it here}

{redirect:{rdIfBlock}}
{{any({1}==yes|{1}==excused|{1}==no|{1}==other):{if({targNotUser}):{commandBlock}}}}{silence}
{embed(title):{titleIfBlocks}}
{embed(description):{{arg1}}}
{=(embedURL):{urlIfBlock}}
{embed(color):{colorIfBlocks}}
{=(footer):{footerIfBlocks}}
{embed(timestamp):now}
{reactu:{reactuEmote}}

Embed

1 line
{"color": 5198940, "image": {"url": "{embedURL}"}, "title": "Title", "author": {"name": "{nameIfBlock}", "icon_url": "{iconIfBlock}"}, "footer": {"text": "{footer}"}}
Raw JSON
{
  "id": 457672,
  "created_at": "2020-11-30T07:30:46.000Z",
  "tag_name": "erg",
  "nsfw": false,
  "owner_id": "709387130723368968",
  "uses": 201,
  "description": null,
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "769666270680842262",
  "sharer": "709387130723368968",
  "content": "{=(COMMENT):─── COMMAND CONFIGURATION ───}\n{=(COMMENT):Daily reset time (24-hour clock). Format `HH:MM` MUST be respected.}\n{=(time.reset):00:00}\n{=(COMMENT):Timezone Management. Set \"timezone.offset\" to 0 if it should return UTC date.\nThis corresponds to the amount of hours there is between your personal timezone and UTC.}\n{=(timezone.offset):-8}\n\n{=(COMMENT):This is the main prefix for Carl-bot on your server. It will be displayed in the embed's footer with the command usage.}\n{=(prefix):!}\n{=(COMMENT):Make sure you don't name your tag \"reset\", as it's already a built-in command. Possible alternatives are \"dreset\" or \"dres\" or \"res\", but can be anything else, as long as it doesn't conflict with an existing command.}\n{=(tag.name):erg}\n\n{=(COMMENT):───────────────────────────────────\nThere should be nothing to touch below. Only do it if you know what you're doing.}\n\n{=(COMMENT):Returns the datetime values **in your own timezone** of today and of the reset, in case you want to display them somewhere.}\n{=(hour.in.second):3600}\n{=(timezone.today.unix):{m:trunc(({timezone.offset}*{hour.in.second})+{unix})}}\n{=(timezone.today.datetime):{strf({timezone.today.unix}):%F %T}}\n\n{=(COMMENT):Today's date and time.}\n{=(today.date):{strf({timezone.today.unix}):%F}}\n{=(today.time):{strf({timezone.today.unix}):%T}}\n{=(today.datetime):{today.date} {today.time}}\n{=(today.unix):{timezone.today.unix}}\n\n{=(COMMENT):Tomorrow's date and time.}\n{=(seconds.in.day):86400}\n{=(one.more.day):{strf({m:trunc({seconds.in.day}+{today.unix})}):%F}}\n{=(tomorrow.date):{one.more.day}}\n{=(tomorrow.datetime):{tomorrow.date} {today.time}}\n\n{=(COMMENT):Checking the sign (positive or negative) of the difference between today's date and the reset date.}\n{=(unix.reset):{strf({today.date} {time.reset}:00):%s}}\n{=(unix.diff):{m:trunc({today.unix}-{unix.reset})}}\n{=(diff.sgn):{m:sgn({unix.diff})}}\n\n{=(COMMENT):If it is positive, it means the reset has already happened today and it should take tomorrow's datetime; otherwise today's datetime.}\n{=(reset.to.take):{if({diff.sgn}==1):{tomorrow.date}|{today.date}} {time.reset}:00}\n{=(reset.datetime):{reset.to.take}}\n{=(reset.unix):{strf({reset.datetime}):%s}}\n\n{=(COMMENT):Actual time remaining between now and the next daily reset!}\n{=(time.remaining):{td({timezone.today.datetime}):{reset.datetime}}}\n\n{=(duration):{replace(%2C,):{urlencode:{replace(second,s):{replace(seconds,s):{replace(minute,m):{replace(minutes,m):{replace(hour,h):{replace(hours,h):{replace(and,):{join():{time.remaining}}}}}}}}}}}}\n\n\n\n{=(COMMENT):Role IDs listed below}\n{=(captainid):769666765172768850}\n{=(coxid):769669093262884945}\n{=(roleidz):782845539225305089,782845753302843422,782845811645349919,782864308685242368}\n{=(yesRole):782845539225305089}\n{=(excusedRole):782845753302843422}\n{=(noRole):782845811645349919}\n{=(otherRole):782864308685242368}\n{=(myID):709387130723368968}\n{=(logChannel):783553194369613864}\n{=(assignedRole):{if({1}==yes):{list(0):{roleidz}}|{if({1}==excused):{list(1):{roleidz}}|{if({1}==no):{list(2):{roleidz}}|{if({1}==other):{list(3):{roleidz}}|{if({1}==help):}}}}}}\n\n{=(commandBlock):c:temprole {target(id)} {duration} {assignedRole}}\n{=(targNotUser):{target(id)}!={user(id)}}\n{=():}\n\n{=(colorIfBlocks):{if({targNotUser}):{if({1}==yes):#4B8B3B|{if({1}==excused):#010203|{if({1}==no):#FF0000|{if({1}==other):#0504aa}}}}|{if({1}==help):#FFA500|{if({1}==):#FFFF33|#FFFF33}}}}\n{=(titleIfBlocks):{any({1}==yes|{1}==excused|{1}==no|{1}==other):{if({targNotUser}):Workout Logging|Uh oh! Mention Error}|{if({1}==help):Command Examples and Definitions|Workout Status Error}}}\n{=(footerIfBlocks):{any({1}==yes|{1}==excused|{1}==no|{1}==other):{if({targNotUser}):All roles regarding workout completion reset at midnight tonight.|{if({1}==help):Note: The field explaining the completion status can be left blank and the command will still run.|If you need help with this command, please run `!erg help {1}`}}}}\n{=(rdIfBlock):{any({1}==yes|{1}==excused|{1}==no|{1}==other):{if({targNotUser}):{logChannel}}|{channel(id)}}}\n{=(reactuEmote):{any({1}==yes|{1}==excused|{1}==no|{1}==other):{if({targNotUser}):✅|❌}|{if({1}==help):✅⬇|⬇}}}\n{=(urlIfBlock):{if({1}==help):{if({2}==yes):https://i.imgur.com/8HJhbxy.png|{if({2}==excused):https://i.imgur.com/DnZqWMX.png|{if({2}==no):https://i.imgur.com/I66faZy.png|{if({2}==other):https://i.imgur.com/tCkCfyj.png}}}}}}\n{=(nameIfBlock):{if({1}==help):{user(proper)}}}\n{=(iconIfBlock):{if({1}==help):{user(avatar)}}}\n{=(properOutput):{if({args(3+)}!=):**Notes:** {args(3+)}|}\n\nApproved by: {mention}}\n{=(badOutput):{mention} Your argument was correct, *however* you __**cannot**__ approve your own workouts. Please ask a coxswain or another team leader to do it for you}\n\n{require(Only coxswains and captains can use this command!):{coxid},{captainid}}\n\n{=(arg1):{lower:{1}}}\n{=({arg1}):Your input did not match one of the available workout statuses. Please type `!erg help` if you need help}\n\n\n{=(COMMENT):switch outputs below}\n{=(yes):{if({targNotUser}):{target(mention)} has **COMPLETED** today's workout and received <@&{yesRole}>.\n{properOutput}|{badOutput}}}\n{=(excused):{if({target(id)}!={user(id)}):{target(mention)} has been **EXCUSED** from today's workout and received <@&{excusedRole}>.\n{properOutput}|{badOutput}}}\n{=(no):{if({target(id)}!={user(id)}):{target(mention)} has been marked **UNEXCUSED** from today's workout and received <@&{noRole}>.\n{properOutput}|{badOutput}}}\n{=(other):{if({target(id)}!={user(id)}):{target(mention)} has **COMPLETED** a different version of today's workout and received <@&{otherRole}>.\n{properOutput}|{badOutput}}}\n{=(help):{mention} please read the following and if you still need help, ask <@{myID}>.\n`!erg yes <@{user(proper)}> did erg but not run`\nThis example will say you did the erg workout and not the run\n\n`!erg excused <@{user(proper)}> had homework`\nThis example will say you had homework, thus being excused from the erg\n\n`!erg no <@{user(proper)}> no communication`\nThis example says you didn't communicate why you were absent Today\n\n`!erg other <@{user(proper)}> did 30 minute bike and 200 jumpies`\nThis example says you were working out, just not doing Secors workout\n\n`!erg help`\nThis will output the block you're reading right now\n\n__Note:__ <@{user(proper)}> is equivalent to a ping, so just type \"@{user(name)}\" then click enter (or the name on your screen) to get the ping\n__**Your ping is:**__ {mention}\n\n> If you have any other suggestions for this command, let <@{myID}> know what you are thinking and he might add it here}\n\n{redirect:{rdIfBlock}}\n{{any({1}==yes|{1}==excused|{1}==no|{1}==other):{if({targNotUser}):{commandBlock}}}}{silence}\n{embed(title):{titleIfBlocks}}\n{embed(description):{{arg1}}}\n{=(embedURL):{urlIfBlock}}\n{embed(color):{colorIfBlocks}}\n{=(footer):{footerIfBlocks}}\n{embed(timestamp):now}\n{reactu:{reactuEmote}}",
  "embed": "{\"color\": 5198940, \"image\": {\"url\": \"{embedURL}\"}, \"title\": \"Title\", \"author\": {\"name\": \"{nameIfBlock}\", \"icon_url\": \"{iconIfBlock}\"}, \"footer\": {\"text\": \"{footer}\"}}",
  "last_fetched": "2026-10-20T23:19:48.967Z"
}