dreset

Privateunrated

Content

102 lines
{=(COMMENT):─── COMMAND CONFIGURATION ───}
{=(COMMENT):Daily reset time (24-hour clock). Format `HH:MM` MUST be respected.}
{=(time.reset):04: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):-3}

{=(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):dreset}

{=(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}}}

{=(COMMENT):Output Management.}
{=(hex0):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hex1):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hex2):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hex3):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hex4):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hex5):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hex6):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hex7):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hex8):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hex9):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hex0):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hexA):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hexB):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hexC):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hexD):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hexE):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}
{=(hexF):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}

{=(randomhex):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}
{=(randomhex1):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}
{=(randomhex2):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}
{=(randomhex3):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}
{=(randomhex4):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}
{=(randomhex5):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}
{=(randomhex6):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}

{=(colorhex):#{randomhex}{randomhex1}{randomhex2}{randomhex3}{randomhex4}{randomhex5}}
{=(em.title):Time Until Daily Reset}
{=(em.description):**{time.remaining}**}
{=(em.footer):{prefix}{tag.name} • Daily Reset Time: {time.reset}}
{=(em.color):{colorhex}}
{embed(color):#{replace(#,):{em.color}}}

{=(COMMENT):Debug variable, in which I call almost all the variables in that code to know which value they return and troubleshoot the command. I very much recommend you do this when debugging your code.}
{=(debug):__Debug:__
today.datetime `{today.datetime}`
today.unix `{unix}`
tomorrow.date `{tomorrow.date}`
tomorrow.datetime `{tomorrow.datetime}`

unix.reset `{unix.reset}`
unix.diff `{unix.diff}`
diff.sgn `{diff.sgn}`

reset.to.take `{reset.to.take}`
reset.datetime `{reset.datetime}`
reset.unix `{reset.unix}`

Timezone Management:
timezone.today.unix `{timezone.today.unix}`
timezone.today.datetime `{timezone.today.datetime}`

time.remaining `{time.remaining}`
}
{debug}

Embed

1 line
{"color": 5198940, "author": {"name": "{em.title}"}, "footer": {"text": "{em.footer}"}, "description": "{em.description}"}
Raw JSON
{
  "id": 406245,
  "created_at": "2020-11-02T15:57:33.000Z",
  "tag_name": "dreset",
  "nsfw": false,
  "owner_id": "274202497936261120",
  "uses": 22,
  "description": null,
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "768261664604291152",
  "sharer": "274202497936261120",
  "content": "{=(COMMENT):─── COMMAND CONFIGURATION ───}\n{=(COMMENT):Daily reset time (24-hour clock). Format `HH:MM` MUST be respected.}\n{=(time.reset):04: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):-3}\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):dreset}\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\n{=(COMMENT):Actual time remaining between now and the next daily reset!}\n{=(time.remaining):{td({timezone.today.datetime}):{reset.datetime}}}\n\n{=(COMMENT):Output Management.}\n{=(hex0):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hex1):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hex2):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hex3):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hex4):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hex5):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hex6):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hex7):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hex8):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hex9):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hex0):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hexA):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hexB):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hexC):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hexD):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hexE):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n{=(hexF):{random:0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}}\n\n{=(randomhex):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}\n{=(randomhex1):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}\n{=(randomhex2):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}\n{=(randomhex3):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}\n{=(randomhex4):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}\n{=(randomhex5):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}\n{=(randomhex6):{#:{hex0},{hex1},{hex2},{hex3},{hex4},{hex5},{hex6},{hex7},{hex8},{hex9},{hexA},{hexB},{hexC},{hexD},{hexE},{hexF}}}\n\n{=(colorhex):#{randomhex}{randomhex1}{randomhex2}{randomhex3}{randomhex4}{randomhex5}}\n{=(em.title):Time Until Daily Reset}\n{=(em.description):**{time.remaining}**}\n{=(em.footer):{prefix}{tag.name} • Daily Reset Time: {time.reset}}\n{=(em.color):{colorhex}}\n{embed(color):#{replace(#,):{em.color}}}\n\n{=(COMMENT):Debug variable, in which I call almost all the variables in that code to know which value they return and troubleshoot the command. I very much recommend you do this when debugging your code.}\n{=(debug):__Debug:__\ntoday.datetime `{today.datetime}`\ntoday.unix `{unix}`\ntomorrow.date `{tomorrow.date}`\ntomorrow.datetime `{tomorrow.datetime}`\n\nunix.reset `{unix.reset}`\nunix.diff `{unix.diff}`\ndiff.sgn `{diff.sgn}`\n\nreset.to.take `{reset.to.take}`\nreset.datetime `{reset.datetime}`\nreset.unix `{reset.unix}`\n\nTimezone Management:\ntimezone.today.unix `{timezone.today.unix}`\ntimezone.today.datetime `{timezone.today.datetime}`\n\ntime.remaining `{time.remaining}`\n}\n{debug}",
  "embed": "{\"color\": 5198940, \"author\": {\"name\": \"{em.title}\"}, \"footer\": {\"text\": \"{em.footer}\"}, \"description\": \"{em.description}\"}",
  "last_fetched": "2026-10-20T22:59:37.472Z"
}