class Sports
Constants
- USER_AGENT
Public Class Methods
Source
# File plugins/sports.rb, line 19 def self.command_pattern /sports(?:\s+(.+))?$/i end
Source
# File plugins/sports.rb, line 25 def self.commentate(args:, network:, channel:, fetch_json:) default_region = BotOptions.get(network: network, channel: channel, key: "location", default: "australia") SportsLookup.lookup(args, default_region: default_region, fetch_json: fetch_json)[:report] end
Public Instance Methods
Source
# File plugins/sports.rb, line 30 def commentate(args:, network:, channel:, fetch_json: method(:fetch_json)) self.class.commentate(args: args, network: network, channel: channel, fetch_json: fetch_json) end
Source
# File plugins/sports.rb, line 38 def execute(m, args = nil) themed_flood_safe_reply( m, self.class.commentate( args: args, network: bot.config.server, channel: m.channel.name, fetch_json: method(:fetch_json) ) ) end
Source
# File plugins/sports.rb, line 34 def fetch_json(url) RabbotHttp.fetch_json(url, user_agent: USER_AGENT) end