Matt Graves tunacubes at gmail.com
Wed Nov 13 17:12:16 CET 2013

I'm using the jabberbot library and there is not a whole lot of documentation on it. Does anyone have experience with this library?

This is basically the only example given:

from jabberbot import JabberBot, botcmd
import datetime

class SystemInfoJabberBot(JabberBot):
    def serverinfo( self, mess, args):
        """Displays information about the server"""
        version = open('/proc/version').read().strip()
        loadavg = open('/proc/loadavg').read().strip()

        return '%s\n\n%s' % ( version, loadavg, )
    def time( self, mess, args):
        """Displays current server time"""
        return str(datetime.datetime.now())

    def rot13( self, mess, args):
        """Returns passed arguments rot13'ed"""
        return args.encode('rot13')

    def whoami(self, mess, args):
        """Tells you your username"""
        return mess.getFrom().getStripped()

username = 'xxxxxx at xxxx.xxxx.com'
password = 'xxxxx'
bot = SystemInfoJabberBot(username,password)

I cannot figure out how I would have it simulate a conversation. For example, if I added 

    def Hello(self, mess, args):
        return "Hi, how are you?"
how would I get it to carry on from here? To look for different answers to the response that was returned. Any bit of information would be appreciated. 

More information about the Python-list mailing list