added logic for start time

master
s00ner 10 months ago
parent a3ea6d41a0
commit 9250e3eb4a
  1. 3
      bot.rb

@ -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))

Loading…
Cancel
Save