aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlas Oliva <blasoliva@gmail.com>2015-01-20 22:26:49 -0300
committerBlas Oliva <blasoliva@gmail.com>2015-01-20 22:26:49 -0300
commitc77763175c5986c1730e789695bd4255b19cb01d (patch)
tree76f6aed606a754a1c1c21f284f7d91ab9420a8c1
parent2c0b12ef6d5fdfb873c4f63fa3270f916e658ee6 (diff)
downloadreebot-c77763175c5986c1730e789695bd4255b19cb01d.tar.gz
reebot-c77763175c5986c1730e789695bd4255b19cb01d.zip
welcome message
-rw-r--r--messages.py3
-rwxr-xr-xrbot.py6
2 files changed, 7 insertions, 2 deletions
diff --git a/messages.py b/messages.py
index 47c4336..c8a308b 100644
--- a/messages.py
+++ b/messages.py
@@ -2,7 +2,8 @@
2""" Reebot's text messages """ 2""" Reebot's text messages """
3 3
4messages = { 4messages = {
5 "welcome" : "Che, I'm here!", 5 "che" : "Che, I'm here!",
6 "hello" : "Hola ", 6 "hello" : "Hola ",
7 "goodbye" : "Bye bye", 7 "goodbye" : "Bye bye",
8 "welcome" : "Welcome to this wonderful channel"
8} 9}
diff --git a/rbot.py b/rbot.py
index c035602..713e75b 100755
--- a/rbot.py
+++ b/rbot.py
@@ -36,12 +36,13 @@ class rBot:
36 # Join channels and send welcome message 36 # Join channels and send welcome message
37 for channel in channels_list: 37 for channel in channels_list:
38 self.server.join( channel ) 38 self.server.join( channel )
39 self.sendmessage( channel, messages['welcome'] ) 39 self.sendmessage( channel, messages['che'] )
40 40
41 # Register handlers 41 # Register handlers
42 self.irc.add_global_handler( 'ping', self.ponger, -42 ) 42 self.irc.add_global_handler( 'ping', self.ponger, -42 )
43 self.irc.add_global_handler( 'privmsg', self.handleprivmessage ) 43 self.irc.add_global_handler( 'privmsg', self.handleprivmessage )
44 self.irc.add_global_handler( 'pubmsg', self.handlepubmessage ) 44 self.irc.add_global_handler( 'pubmsg', self.handlepubmessage )
45 self.irc.add_global_handler( 'welcome', handlewelcome )
45 46
46 # Server connection checker 47 # Server connection checker
47 if self.server.is_connected(): 48 if self.server.is_connected():
@@ -85,6 +86,9 @@ class rBot:
85 if argument.find ( 'hola ' + nickname ) == 0: 86 if argument.find ( 'hola ' + nickname ) == 0:
86 self.sendmessage( target, messages['hello'] + source ) 87 self.sendmessage( target, messages['hello'] + source )
87 88
89 def handlewelcome(self, connection, event):
90 self.sendmessage( event.target, messages['welcome'] )
91
88 def feed_refresh(self): 92 def feed_refresh(self):
89 93
90 msgqueue = [] 94 msgqueue = []