class HexTokenBot::BotServer

Attributes

bot_servers[RW]
scheduler[RW]

Public Class Methods

new() click to toggle source
# File lib/hex_token_bot/bot_server.rb, line 8
def initialize

  scheduler = Rufus::Scheduler.new

  HexTokenBot.bots.each do |bot|
    case bot['bot_name']
      when 'bot_auto_trans'
        when_ever = bot['bot_params']['when_ever']
        HexTokenBot::Bots::BotAutoTrans.set(:name, bot['bot_name'])
        scheduler.every when_ever||'3s', :tag => bot['bot_name'] do
          puts 'Hello... Bots'
          HexTokenBot::Bots::BotAutoTrans.set(:channels, bot['bot_data_channels'])
          HexTokenBot::Bots::BotAutoTrans.set(:markets, bot['bot_markets'])
          HexTokenBot::Bots::BotAutoTrans.run!
        end
    end
  end
end

Public Instance Methods

run!() click to toggle source
# File lib/hex_token_bot/bot_server.rb, line 27
def run!
  while true
    puts ".."
    sleep(2)
  end
end