class Web
Public Class Methods
Source
# File plugins/web.rb, line 19 def self.command_pattern /web(?:\s+(.+))?$/i end
Source
# File plugins/web.rb, line 27 def self.handle(key:, sites:, bot_id:, public_base:, shared:, fetch: BotSites.method(:default_fetch), ptr_resolve: nil) status, payload = BotSites.handle( sites: sites, bot_id: bot_id, key: key, public_base: public_base, shared: shared, fetch: fetch, ptr_resolve: ptr_resolve ) case status when :empty [:empty, nil] when :not_found [:error, WebReport.not_found(payload)] when :ok [:ok, WebReport.list( entries: payload[:entries], bot_id: payload[:bot_id], key: payload[:key] )] end end
Source
# File plugins/web.rb, line 23 def self.parse_nick_web_prompt(message, bot:) BotSites.parse_nick_web_prompt(message, bot: bot) end
Public Instance Methods
Source
# File plugins/web.rb, line 53 def execute(m, key = nil) return unless m.channel return unless BotIdentity.owner_bot?(bot) return if sites.empty? deliver(m, key) end
Source
# File plugins/web.rb, line 61 def try_nick_web_command(m) return unless m.channel key = self.class.parse_nick_web_prompt(m.message, bot: bot) return if key.nil? return if sites.empty? deliver(m, key.empty? ? nil : key) end