]> kaliko git repositories - sid.git/blob - bot.py
Cleanup
[sid.git] / bot.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3
4 import getpass
5
6 from sid.sid import MUCBot
7 from sid.ping import Ping
8 from sid.feeds import Feeds
9
10 JID = 'bot@example.org'
11 NICK = 'sid'
12 PASS = getpass.getpass('Password for "{}": '.format(JID))
13 ROOM = 'room@conf.example.org'
14
15 def main():
16     Feeds.TEMPO = 60
17     xmpp = MUCBot(JID, PASS, ROOM, NICK)
18     xmpp.register_bot_plugin(Feeds)
19     xmpp.register_bot_plugin(Ping)
20     try:
21         xmpp.connect()
22         xmpp.process()
23     except KeyboardInterrupt:
24         xmpp.shutdown_plugins()
25     xmpp.log.info('Done')
26
27 # Script starts here
28 if __name__ == '__main__':
29     main()
30
31 # VIM MODLINE
32 # vim: ai ts=4 sw=4 sts=4 expandtab