added logic for start time

master
s00ner 2021-10-13 15:52:26 -04:00
parent a3ea6d41a0
commit 9250e3eb4a
1 changed files with 2 additions and 1 deletions

3
bot.rb
View File

@ -17,7 +17,8 @@ quotes = File.read("Game Files/blurbsx.txt").split("##")
quotes.delete_at(0) # Remove empty first item
scheduler = Rufus::Scheduler.new
start_time = Rufus::Scheduler.parse('08:00') # what time of day the message should send
# start tomorrow if start_time has passed
start_time += Rufus::Scheduler.parse('1d') if start_time < Time.now
scheduler.every '1d', first_at: start_time do
bot.send_message(852541842511495210, random_quote(quotes))