Class: Twitchbot::MessageQueuePlugin
- Inherits:
-
Object
- Object
- Twitchbot::MessageQueuePlugin
- Includes:
- TimedPlugin
- Defined in:
- lib/twitchbot/plugin/message_queue_plugin.rb
Overview
Plugin to handle sending messages to the server that have been queued from any plugins running.
TODO: Implement different levels of rate limiting according to bot status e.g. :mod, :verified, :trusted
Constant Summary
Constants included from TimedPlugin
Instance Method Summary collapse
-
#send_message(handler) ⇒ Object
Pull a message from the message queue if any are available and send to the server.
Methods included from TimedPlugin
#close, #error, included, #message, #open
Instance Method Details
#send_message(handler) ⇒ Object
Pull a message from the message queue if any are available and send to the server
15 16 17 18 19 20 21 22 |
# File 'lib/twitchbot/plugin/message_queue_plugin.rb', line 15 def (handler) queue = handler.bot. unless queue.empty? = queue.pop puts "< #{}" if handler.bot.debug handler.connection.send end end |