Would it be possible to make a command whose response changes depending on some kind of variable like days?

I want to make a command which changes between some variables.

Especifically, I want to make a command with the stream schedule, but just for the “next” stream.
For example, I want it to show: “Next Stream at 9:00 pm PT - 4am GMT, etc…” but i want it to change at a certain hour.
Just think of it showing “9pm PT - 4am GMT” until that hour (the hour when the stream has probably already started) and then changing to “1am PT - 8am GMT” until that stream starts, and then changing to the hour of the next stream.
Is it possible? I know that it is possible to create something that changes each day of the week, but im not certainly sure of how and if it is actually going to work with NightBot

1 Like
$(eval (() => {var r='$(urlfetch http://api.newtimenow.com/day/?time=1:00am&zone=America/North_Dakota/Center&buff=720)'; return r!=='Now'?`There's at least ${r} left in Noelle's stream!`:`Noelle is past her regularly scheduled ending time!`;})())

This is my code for my !end command. If used from 7:00pm-1:00am CDT, it will tell viewers how much longer I’ll be streaming, and if used after 1:00am CDT, it will tell viewers that I’m past my usually scheduled end time.

Perhaps you can mess with it to make what you’re looking for.

Thanks, this will help me with one part of the command, but I’m not pretty sure about how to change it with different hours for each day of the week, as the schedule changes along the week

If you post your weekly schedule, either I or someone else can look into writing up some code for your command.

2 Likes

UTC +2 would be
Monday = 22:00
Tuesday, Wednesday and Thursday = 17:30 and 22:00
Friday: 12:00
Sunday: 22:00

Mi idea was having 3 or 4 timezones in each hour.
Exactly UTC+2 would be for Spain, GMT-3 would be for Chile and Argentina, and GMT-5 for Mexico and Colombia

Could someone help me?

I’m not sure what you mean by multiple timezones. Is the intent to show a localized schedule?

Mmm… I want a command which changes its content at an specific hour each day of the week.

For example, think of a !hello command which changes each day
At Mondays: “Hi”
At Tuesdays: “Hello”
At Wednesdays: “Bonjour”
etc…

Is this kind of command possible?

While it is possible, there is not a pre-built solution for you. You would need to write a script yourself with the eval variable, or find someone who can do that for you.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.