class Twitchbot::MessageQueuePlugin

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

Public Instance Methods

send_message(handler) click to toggle source

Pull a message from the message queue if any are available and send to the server

# File lib/twitchbot/plugin/message_queue_plugin.rb, line 15
def send_message(handler)
  queue = handler.bot.message_queue
  unless queue.empty?
    message = queue.pop
    puts "< #{message}" if handler.bot.debug
    handler.connection.send message
  end
end