Class: Elephrame::Bots::PeriodInteract
- Includes:
- AllInteractions, Scheduler, Streaming
- Defined in:
- lib/elephrame/mix/bots.rb
Overview
a bot that posts things on an interval but can also respond to interactions
requires on_* variables to be set before running, otherwise the bot won’t react to interactions
Constant Summary
Constants inherited from BaseBot
BaseBot::FNGabLink, BaseBot::NoBotRegex
Instance Attribute Summary
Attributes included from AllInteractions
#on_boost, #on_fave, #on_follow
Attributes included from Reply
Attributes included from Scheduler
Attributes included from Streaming
Attributes inherited from BaseBot
#client, #failed, #max_retries, #strip_html, #username
Instance Method Summary collapse
-
#initialize(intv) ⇒ Elephrame::Bots::PeriodInteract
constructor
creates a new PeriodInteract bot.
-
#run ⇒ Object
Runs the bot.
Methods included from AllInteractions
Methods included from Reply
#reply, #reply_with_mentions, #run_reply
Methods included from Scheduler
#run_scheduled, #setup_scheduler
Methods included from Streaming
Methods inherited from BaseBot
backup_method, #fetch_account_id, #fetch_list_id, #find_ancestor, #no_bot?, #post
Constructor Details
#initialize(intv) ⇒ Elephrame::Bots::PeriodInteract
creates a new PeriodInteract bot
29 30 31 32 33 34 |
# File 'lib/elephrame/mix/bots.rb', line 29 def initialize intv super() setup_scheduler intv setup_streaming end |
Instance Method Details
#run ⇒ Object
Runs the bot. requires a block for periodic post logic, but relies on on_* functions for interaction logic. See Elephrame::AllInteractions for more details.
41 42 43 44 |
# File 'lib/elephrame/mix/bots.rb', line 41 def run run_scheduled &Proc.new run_interact end |