Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

vistahigherlearning / logstash   deb

Repository URL to install this package:

/ opt / logstash / vendor / bundle / jruby / 1.9 / gems / cinch-2.1.0 / examples / plugins / last_nick.rb

require 'cinch'

class Nickchange
  include Cinch::Plugin
  listen_to :nick

  def listen(m)
    # This will send a PM to the user who changed his nick and inform
    # him of his old nick.
    m.reply "Your old nick was: #{m.user.last_nick}" ,true
  end
end

bot = Cinch::Bot.new do
  configure do |c|
    c.nick            = "cinch_nickchange"
    c.server          = "irc.freenode.org"
    c.channels        = ["#cinch-bots"]
    c.verbose         = true
    c.plugins.plugins = [Nickchange]
  end
end

bot.start