Sha256: 25eb4d1c62ebc3727b76e8b0360247a765cb1797fbb9342ffdef2758e480d1d9

Contents?: true

Size: 343 Bytes

Versions: 6

Compression:

Stored size: 343 Bytes

Contents

hook(type: :code, code: @numeric::WHOISUSER) do |dat|
  m = /(.+?) (.+?) (.+?) \* :.*/.match(dat[:extra])
  dat[:plug].users[m[1]] = {} unless dat[:plug].users[m[1]]
  u = dat[:plug].users[m[1]]
  u[:nick] = m[1]
  u[:user] = m[2]
  u[:host] = m[3]
  emit(dat.merge(type: :code_whoisuser, nick: u[:nick], user: u[:user], host: u[:host]))
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
protonbot-0.3.7 lib/protonbot/core_plugin/codes/whois.rb
protonbot-0.3.6 lib/protonbot/core_plugin/codes/whois.rb
protonbot-0.3.5 lib/protonbot/core_plugin/codes/whois.rb
protonbot-0.3.4 lib/protonbot/core_plugin/codes/whois.rb
protonbot-0.3.3 lib/protonbot/core_plugin/codes/whois.rb
protonbot-0.3.2 lib/protonbot/core_plugin/codes/whois.rb