Sha256: 0fce7eb8ce00caf09ae95d9d9ff078a3a0a477a1e62400517f8b7394b91f7010
Contents?: true
Size: 538 Bytes
Versions: 16
Compression:
Stored size: 538 Bytes
Contents
require "fortune_gem" module Cinch module Plugins class Fortune include Cinch::Plugin match /f$/ set :plugin_name, 'fortune' set :help, <<EOT .f gives you a bit of random wisdom. EOT def new(bot) @bot = bot end def fortune max_length = 256 fortune = FortuneGem.give_fortune(:max_length => max_length) fortune.gsub(/[\n]/, "").gsub(/[\t]/, " ").gsub("?A:", "? A:") end def execute(m) m.reply(fortune) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems