summaryrefslogtreecommitdiff
path: root/lib/rbot/rfc2812.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-02-20 08:46:00 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-02-20 08:46:00 +0000
commitceebd54c0a6b769d2a278967fc00c1b05c8cca37 (patch)
tree51a8146c7b574a261bea2f7580df8b0f99d495e8 /lib/rbot/rfc2812.rb
parentbae0027e9c1b9ff2526022c63b984710605ffc12 (diff)
New IRC Framework: bot now keeps track of his nick correctly across disconnects
Diffstat (limited to 'lib/rbot/rfc2812.rb')
-rw-r--r--lib/rbot/rfc2812.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/rbot/rfc2812.rb b/lib/rbot/rfc2812.rb
index 1a5adb84..5dec464c 100644
--- a/lib/rbot/rfc2812.rb
+++ b/lib/rbot/rfc2812.rb
@@ -821,7 +821,7 @@ module Irc
# create a new Client instance
def initialize
@server = Server.new # The Server
- @user = @server.user("") # The User representing the client on this Server
+ @user = @server.user("") # The User representing the client on this Server
@handlers = Hash.new
@@ -830,6 +830,12 @@ module Irc
@tmpusers = []
end
+ # clear the server and reset the User
+ def reset
+ @server.clear
+ @user = @server.user("")
+ end
+
# key:: server event to handle
# value:: proc object called when event occurs
# set a handler for a server event