Skip to content

Instantly share code, notes, and snippets.

@ldesgoui
Last active January 30, 2026 14:47
Show Gist options
  • Select an option

  • Save ldesgoui/f2635dbebf844e206aef6969f4a6584b to your computer and use it in GitHub Desktop.

Select an option

Save ldesgoui/f2635dbebf844e206aef6969f4a6584b to your computer and use it in GitHub Desktop.
!nexthero
15:31 twiikuu: !nexthero
15:31 Nightbot: Next heroes are released in 3 days, 7 hours, 28 minutes, and then 3 days after that
const anchor_date = new Date(176886e7); // Mon Jan 19 2026 22:00:00 GMT+0000
const time_until = day_offset => new Date(anchor_date - Date.now() + Date.UTC(70, 0, day_offset + 1));
for(
day_offsets = [7, 10, 14, 17, 21, 24];
next = time_until(day_offsets[0]),
next < 0;
day_offsets.shift()
);
// At this point, day_offsets contains only dates in the futures or nothing at all
day_offsets[0] ?
`Next heroes are released in ${next.getUTCDate() - 1} days, ${next.getUTCHours()} hours, ${next.getMinutes()} minutes, `
+ `and then ${day_offsets[1] ? `${day_offsets[1] - day_offsets[0]} days after that` : "that's it"}`
:
`All heroes are out`
!addcom !nexthero $(eval for(d=n=>new Date(new Date(176886e7)-Date.now()+Date.UTC(70,0,n+1)),x=[7,10,14,17,21,24];a=d(x[0]),a<0;x.shift());x[0]?`Next heroes are released in ${a.getUTCDate()-1} days, ${a.getUTCHours()} hours, ${a.getMinutes()} minutes, and then ${x[1]?`${x[1]-x[0]} days after that`:"that's it"}`:`All heroes are out`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment