Bachir Soussi Chiadmi 7 years ago
parent
commit
416b134ea4
1 changed files with 12 additions and 12 deletions
  1. 12 12
      cedbot_muc.py

+ 12 - 12
cedbot_muc.py

@@ -127,21 +127,21 @@ class MUCBot(sleekxmpp.ClientXMPP):
         """
         if msg['mucnick'] != self.nick:
             if self.nick in msg['body']:
-                send_msg(self, msg, ":), %s." % msg['mucnick'])
+                self.send_msg(self, msg, ":), %s." % msg['mucnick'])
 
                 if '?' in msg['body']:
                     if 'who are you' in msg['body']:
-                        send_msg(self, msg, "I am the chatbot from De La Convivialité des Espaces Discrets")
-                        send_msg(self, msg, "check this http://convivialite-espaces-discrets.net ;)")
+                        self.send_msg(self, msg, "I am the chatbot from De La Convivialité des Espaces Discrets")
+                        self.send_msg(self, msg, "check this http://convivialite-espaces-discrets.net ;)")
                     else:
-                        send_msg(self, msg, "humm ...")
-                        send_msg(self, msg, "it seems that you asked me a question")
-                        send_msg(self, msg, "but i'm not able to understand it ... yet :/")
-                        send_msg(self, msg, "I'm just a bot after all")
-                        send_msg(self, msg, "but I'll try to learn how to answer you")
-                        send_msg(self, msg, "please come back later")
-                        send_msg(self, msg, "i'll tell you when i'm ready :)")
-                        learn(msg['body'], msg['mucnick'])
+                        self.send_msg(self, msg, "humm ...")
+                        self.send_msg(self, msg, "it seems that you asked me a question")
+                        self.send_msg(self, msg, "but i'm not able to understand it ... yet :/")
+                        self.send_msg(self, msg, "I'm just a bot after all")
+                        self.send_msg(self, msg, "but I'll try to learn how to answer you")
+                        self.send_msg(self, msg, "please come back later")
+                        self.send_msg(self, msg, "i'll tell you when i'm ready :)")
+                        self.learn(msg['body'], msg['mucnick'])
 
     def muc_online(self, presence):
         """
@@ -156,7 +156,7 @@ class MUCBot(sleekxmpp.ClientXMPP):
                         to see how else it may be used.
         """
         if presence['muc']['nick'] != self.nick:
-            send_msg(msg="Hello, %s %s" % (presence['muc']['role'],presence['muc']['nick']))
+            self.send_msg(self, msg, "Hello, %s %s" % (presence['muc']['role'],presence['muc']['nick']))
 
 
 if __name__ == '__main__':