Class: Tkellem::BacklogCommand
- Inherits:
-
TkellemBot::Command
- Object
- TkellemBot::Command
- Tkellem::BacklogCommand
- Defined in:
- lib/tkellem/plugins/backlog.rb
Instance Attribute Summary
Attributes inherited from TkellemBot::Command
#args, #bouncer, #conn, #options, #opts
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from TkellemBot::Command
admin_option, admin_user?, build_options, #initialize, option, register, resources, #respond, run, #show_help, #user
Constructor Details
This class inherits a constructor from Tkellem::TkellemBot::Command
Class Method Details
.admin_only? ⇒ Boolean
265 266 267 |
# File 'lib/tkellem/plugins/backlog.rb', line 265 def self.admin_only? false end |
Instance Method Details
#execute ⇒ Object
269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/tkellem/plugins/backlog.rb', line 269 def execute hour_str = args.pop hours = hour_str.to_f hours *= 24 if hour_str && hour_str[-1] == 'd'[-1] hours = 1 if hours <= 0 || hours >= (24*365) cutoff = hours.hours.ago backlog = Backlog.get_instance(bouncer) rooms = [args.pop].compact if rooms.empty? rooms = backlog.all_existing_ctxs end backlog.send_backlog_since(conn, cutoff, rooms) end |