-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·35 lines (27 loc) · 937 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python2.7
import sys, os, os.path
if os.path.dirname(__file__):
os.chdir(os.path.dirname(__file__))
sys.path[0:0] = ['.', 'ameliabot', 'page', 'lib']
assert sys.version_info[:2] == (2, 7), 'Python 2.7 is required.'
if __name__ == '__main__':
conf = {
'server': 'localhost',
'port': 6667,
'nick': 'PageBot',
'user': 'PageBot',
'name': 'https://github.com/joodicator/PageBot',
'channels': ['#PageBot'],
'plugins': ['runtime', 'message', 'auth', 'control', 'channel', 'tell']
}
execfile('conf/bot.py', conf)
if '--debug' in sys.argv: conf['plugins'].insert(0, 'debug')
import amelia
from untwisted.event import CLOSE
bot = amelia.AmeliaBot(conf)
bot.domain = 'bot'
try:
bot.mainloop()
except BaseException as e:
bot.drive('EXCEPTION', bot, e)
bot.mainloop()