]> kaliko git repositories - sid.git/blob - bot.py
Fixed traceback logging
[sid.git] / bot.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3
4 from sid.sid import MUCBot
5 from sid.echo import Echo
6 from sid.feeds import Feeds
7
8 JID = 'bot@example.org'
9 NICK = 'sid'
10 PASS = '53cr34'
11 ROOM = 'room@conf.example.org'
12
13 def main():
14     Feeds.TEMPO = 60
15     xmpp = MUCBot(JID, PASS, ROOM, NICK)
16     xmpp.register_bot_plugin(Feeds)
17     # Connect to the XMPP server and start processing XMPP stanzas.
18     if xmpp.connect():
19         # If you do not have the dnspython library installed, you will need
20         # to manually specify the name of the server if it does not match
21         # the one in the JID. For example, to use Google Talk you would
22         # need to use:
23         #
24         # if xmpp.connect(('talk.google.com', 5222)):
25         #     ...
26         xmpp.process(block=True)
27         xmpp.shutdown_plugins()
28         xmpp.log.info('Done')
29     else:
30         xmpp.log.info('Unable to connect.')
31
32 # Script starts here
33 if __name__ == '__main__':
34     main()
35
36 # VIM MODLINE
37 # vim: ai ts=4 sw=4 sts=4 expandtab