Class: Elephrame::Bots::Periodic

Inherits:
BaseBot
  • Object
show all
Includes:
Scheduler
Defined in:
lib/elephrame/rest/bots.rb

Overview

a bot that runs commands based off of an interval or a cron string

Constant Summary

Constants inherited from BaseBot

BaseBot::NoBotRegex

Instance Attribute Summary

Attributes included from Scheduler

#schedule, #scheduler

Attributes inherited from BaseBot

#client, #failed, #max_retries, #strip_html, #username

Instance Method Summary collapse

Methods included from Scheduler

#run_scheduled, #setup_scheduler

Methods inherited from BaseBot

#find_ancestor, #no_bot?, #post

Constructor Details

#initialize(intv) ⇒ Elephrame::Bots::Periodic

creates a new Periodic bot

'00 12 * * *' (every day at 12:00)
'00 00 25 12 *' (midnight on christmas)

Parameters:

  • intv (String)

    string specifying interval to post. ex: '3h' (every 3 hours) '20m' (every 20 minutes)


24
25
26
27
28
# File 'lib/elephrame/rest/bots.rb', line 24

def initialize intv
  super()
  
  setup_scheduler intv
end