summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/ircbot.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index 8be9cb5f..403f496d 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -1054,8 +1054,14 @@ class Bot
end
# set topic of channel +where+ to +topic+
- def topic(where, topic)
- sendq "TOPIC #{where} :#{topic}", where, 2
+ # can also be used to retrieve the topic of channel +where+
+ # by omitting the last argument
+ def topic(where, topic=nil)
+ if topic.nil?
+ sendq "TOPIC #{where}", where, 2
+ else
+ sendq "TOPIC #{where} :#{topic}", where, 2
+ end
end
def disconnect(message=nil)