events

Privateunrated

Content

63 lines
{=(input):{lower:{args}}}
{=(comment):The following sections are the user defined variables.}
{=(comment):This was created with a timezone of UTC-8 in mind, so that's how it's set to calculate things. If you're using this for something different, you'll need to adjust the UTC offset here.}
{=(offset):-8}

{=(comment):This section is where you define the event names}
{=(event_name_1):Boss Rush}
{=(event_name_2):Siege War}

{=(comment):This section is where you define the event day from 0-6, corresponding to Sunday-Saturday  (use the day the event occurs on according to the UTC offset).}
{=(event_day_1):0}
{=(event_day_2):6}

{=(comment):This section is where you define the event time in 24 hour format (e.g. 14:30 for 2:30pm). Use the time based on the UTC offset set above - the tag will correct it to UTC for the calculations.}
{=(event_time_1):19:00}
{=(event_time_1):20:00}

{=(comment): This prettifies the output (on the desktop client). BlockDisplay changes how the code block that displays the time colors the numbers and text (colors don't display on mobile). Leave blank for white display. No space before. For more information, check out https://gist.github.com/matthewzring/9f7bbfd102003963f9be7dbcf7d40e51}
{=(BlockDisplay):ml}

{=(comment):The rest of the tag is dedicated to calculating the information required to output a countdown timer.}

{=(comment):Translating the args into the event number, and printing a help message if there are no args}
{=(event_1):{lower:{event_name_1}}}
{=(event_2):{lower:{event_name_2}}}
{=(event):{if({input}=={event_1})1|{if({input}=={event_2}):2|0}}}
{break({event}==0):You need to specify an event; you can choose {event_name_1}, {event_name_2}.}

{=(comment):Defining time in seconds}
{=(week):604800}
{=(day):86400}
{=(hr):3600}
{=(min):60}

{=(comment):This section establishes how many seconds into the week it currently is}

{=(c_day):{m:{strf:%w}*{day}}}
{=(c_hr):{m:{strf:%-H}*{hr}}}
{=(c_min):{m:{strf:%-M}*{min}}}
{=(c_time):{m:{c_day}+{m:{c_hr}+{m:{offset}*{hr}}}+{c_min}}}

{=(comment):Now we establish the number of seconds into a week the event time is.}

{=(e_day):{m:{event_day_{event}}*{day}}}
{=(e_hr):{m:{event_time_{event}(1)::}*{hr}}}
{=(e_min):{m:{event_time_{event}(2)::}*{min}}}
{=(e_time):{m:{e_day}+{e_hr}+{e_min}}}

{=(comment):Here Carl compares the current day of the week to your event day, to determine if it has already occurred or is yet to come this week}
{=(this_week):{if({c_time}<={e_time}):yes|no}}

{=(comment):This section calculates the delta between the current time and event time.}
{=(td):{if({this_week}==yes):{m:{e_time}-{c_time}}|{m:{week}+{e_time}-{c_time}}}}

{=(comment):This section breaks down the time delta into a DD HH MM format for the countdown.}
{=(cd_day):{m:trunc({td}/{day})}}
{=(cd_hr):{m:trunc({m:{m:{td}-{m:{cd_day}*{day}}}/{hr}})}}
{=(cd_min):{m:trunc({m:{m:{td}-{m:{cd_day}*{day}}-{m:{cd_hr}*{hr}}}/{min}})}}

{=(comment):This is where the tag generates the output}
{=(title_day):{list({event_day_{event}}):Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday}}
{=(title_1):{event_name_{event}} -  {title_day} @ {event_time_{event}}}
{=(output):{cd_day} days {cd_hr} hours {cd_min} minutes}

Embed

1 line
{"color": 2793880, "fields": [{"name": "{title_1}", "value": "```{BlockDisplay}\n{output}```", "inline": false}]}
Raw JSON
{
  "id": 196664,
  "created_at": "2022-04-26T10:36:17.898Z",
  "tag_name": "events",
  "nsfw": false,
  "owner_id": "148905756123463680",
  "uses": 90,
  "description": null,
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "702171264856490044",
  "sharer": "148905756123463680",
  "content": "{=(input):{lower:{args}}}\n{=(comment):The following sections are the user defined variables.}\n{=(comment):This was created with a timezone of UTC-8 in mind, so that's how it's set to calculate things. If you're using this for something different, you'll need to adjust the UTC offset here.}\n{=(offset):-8}\n\n{=(comment):This section is where you define the event names}\n{=(event_name_1):Boss Rush}\n{=(event_name_2):Siege War}\n\n{=(comment):This section is where you define the event day from 0-6, corresponding to Sunday-Saturday  (use the day the event occurs on according to the UTC offset).}\n{=(event_day_1):0}\n{=(event_day_2):6}\n\n{=(comment):This section is where you define the event time in 24 hour format (e.g. 14:30 for 2:30pm). Use the time based on the UTC offset set above - the tag will correct it to UTC for the calculations.}\n{=(event_time_1):19:00}\n{=(event_time_1):20:00}\n\n{=(comment): This prettifies the output (on the desktop client). BlockDisplay changes how the code block that displays the time colors the numbers and text (colors don't display on mobile). Leave blank for white display. No space before. For more information, check out https://gist.github.com/matthewzring/9f7bbfd102003963f9be7dbcf7d40e51}\n{=(BlockDisplay):ml}\n\n{=(comment):The rest of the tag is dedicated to calculating the information required to output a countdown timer.}\n\n{=(comment):Translating the args into the event number, and printing a help message if there are no args}\n{=(event_1):{lower:{event_name_1}}}\n{=(event_2):{lower:{event_name_2}}}\n{=(event):{if({input}=={event_1})1|{if({input}=={event_2}):2|0}}}\n{break({event}==0):You need to specify an event; you can choose {event_name_1}, {event_name_2}.}\n\n{=(comment):Defining time in seconds}\n{=(week):604800}\n{=(day):86400}\n{=(hr):3600}\n{=(min):60}\n\n{=(comment):This section establishes how many seconds into the week it currently is}\n\n{=(c_day):{m:{strf:%w}*{day}}}\n{=(c_hr):{m:{strf:%-H}*{hr}}}\n{=(c_min):{m:{strf:%-M}*{min}}}\n{=(c_time):{m:{c_day}+{m:{c_hr}+{m:{offset}*{hr}}}+{c_min}}}\n\n{=(comment):Now we establish the number of seconds into a week the event time is.}\n\n{=(e_day):{m:{event_day_{event}}*{day}}}\n{=(e_hr):{m:{event_time_{event}(1)::}*{hr}}}\n{=(e_min):{m:{event_time_{event}(2)::}*{min}}}\n{=(e_time):{m:{e_day}+{e_hr}+{e_min}}}\n\n{=(comment):Here Carl compares the current day of the week to your event day, to determine if it has already occurred or is yet to come this week}\n{=(this_week):{if({c_time}<={e_time}):yes|no}}\n\n{=(comment):This section calculates the delta between the current time and event time.}\n{=(td):{if({this_week}==yes):{m:{e_time}-{c_time}}|{m:{week}+{e_time}-{c_time}}}}\n\n{=(comment):This section breaks down the time delta into a DD HH MM format for the countdown.}\n{=(cd_day):{m:trunc({td}/{day})}}\n{=(cd_hr):{m:trunc({m:{m:{td}-{m:{cd_day}*{day}}}/{hr}})}}\n{=(cd_min):{m:trunc({m:{m:{td}-{m:{cd_day}*{day}}-{m:{cd_hr}*{hr}}}/{min}})}}\n\n{=(comment):This is where the tag generates the output}\n{=(title_day):{list({event_day_{event}}):Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday}}\n{=(title_1):{event_name_{event}} -  {title_day} @ {event_time_{event}}}\n{=(output):{cd_day} days {cd_hr} hours {cd_min} minutes}",
  "embed": "{\"color\": 2793880, \"fields\": [{\"name\": \"{title_1}\", \"value\": \"```{BlockDisplay}\\n{output}```\", \"inline\": false}]}",
  "last_fetched": "2026-10-20T21:33:50.180Z"
}