From 94aaa824f193681da6d03de6fb3f55dc6e4bb9b6 Mon Sep 17 00:00:00 2001 From: urlbot Date: Mon, 1 Dec 2014 11:59:29 +0100 Subject: [PATCH] cleanup; use a more reasonable config{} definition method --- bot.py | 10 ---------- local_config.py.skel | 12 +++++++----- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/bot.py b/bot.py index eb1d547..6ed29a1 100755 --- a/bot.py +++ b/bot.py @@ -26,7 +26,6 @@ def message_handler(connect_object, message_node): typ='groupchat' ) ) -# send_msg('hello %s!' % msg_from) try: print '%20s: %s' %(msg_from, msg_body) @@ -44,15 +43,6 @@ client.RegisterHandler('message', message_handler) client.send(xmpp.Presence(to=(conf('room') + '/' + conf('nick')))) -def send_msg(msg='''wee, I'm a native bot.'''): - client.send( - xmpp.protocol.Message( - to=conf('room'), - body=msg, - typ='groupchat' - ) - ) - while (t + time.time()) < 30: client.Process(1) diff --git a/local_config.py.skel b/local_config.py.skel index ef99f78..baf07f2 100644 --- a/local_config.py.skel +++ b/local_config.py.skel @@ -4,11 +4,13 @@ if '__main__' == __name__: print '''don't try running this''' exit(-1) -config = {} -config['jid'] = '' -config['password'] = '' -config['room'] = '' -config['nick'] = '' +config = { + 'jid': '', + 'password': '', + 'room': '', + 'nick': '', + 'nick': 'urlbot' +} def conf(val): if val in config.keys():