Sha256: d4378a1ad1769d7dabe63775c5ec15aab9adacf9405ced67c497a4574b74bd35

Contents?: true

Size: 683 Bytes

Versions: 7

Compression:

Stored size: 683 Bytes

Contents

require 'twss-classifier'

# A simple plugin that feeds everything said in the room through the
# twss gem. Requires the 'twss' gem, obviously.
class Robut::Plugin::TWSS
  include Robut::Plugin

  # Returns a description of how to use this plugin
  def usage
    "<words> - responds with \"That's what she said!\" if #{nick} thinks <words> is a valid TWSS"
  end

  # Responds "That's what she said!" if the TWSS gem returns true for
  # +message+. Strips out any reference to our nick in +message+
  # before it stuffs +message+ into the gem.
  def handle(time, sender_nick, message)
    reply("That's what she said!") if TWSSClassifier.is_twss?(words(message).join(" "))
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sclemmer-robut-0.6.3 lib/robut/plugin/twss.rb
sclemmer-robut-0.6.2 lib/robut/plugin/twss.rb
sclemmer-robut-0.6.1 lib/robut/plugin/twss.rb
sclemmer-robut-0.6.0 lib/robut/plugin/twss.rb
sclemmer-robut-0.5.4 lib/robut/plugin/twss.rb
sclemmer-robut-0.5.3 lib/robut/plugin/twss.rb
sclemmer-robut-0.5.2 lib/robut/plugin/twss.rb