X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=bot.py;h=42644bc457b77e85ee7016404ff4ca9cfc2b3cc7;hb=d360b6cedd5c9527d8a5be8c14f48f2f5f926a6f;hp=d283db99ff338798409e5b9292b98d11447701d3;hpb=f2f44c64470d0967913feb1bfb9868fa0c7d9e1b;p=sid.git diff --git a/bot.py b/bot.py index d283db9..42644bc 100644 --- a/bot.py +++ b/bot.py @@ -17,20 +17,12 @@ def main(): xmpp = MUCBot(JID, PASS, ROOM, NICK) xmpp.register_bot_plugin(Feeds) xmpp.register_bot_plugin(Ping) - # Connect to the XMPP server and start processing XMPP stanzas. - if xmpp.connect(): - # If you do not have the dnspython library installed, you will need - # to manually specify the name of the server if it does not match - # the one in the JID. For example, to use Google Talk you would - # need to use: - # - # if xmpp.connect(('talk.google.com', 5222)): - # ... - xmpp.process(block=True) + try: + xmpp.connect() + xmpp.process() + except KeyboardInterrupt: xmpp.shutdown_plugins() - xmpp.log.info('Done') - else: - xmpp.log.info('Unable to connect.') + xmpp.log.info('Done') # Script starts here if __name__ == '__main__':