juju/bot.py

39 lines
931 B
Python
Raw Normal View History

#!/usr/bin/env python3
import json
import sys
import pinhook.bot
with open('config.json') as c:
config = json.load(c)
if __name__ == '__main__':
if len(sys.argv) > 1:
if sys.argv[1] == '--test-mode':
channels = ['#jmjl-devel']
nick = 'ju[dev]'
prefix_plugins = True
cmd_prefix='^'
else:
channels = config['channels']
prefix_plugins = False
cmd_prefix='&'
nick = 'ju'
else:
channels = config['channels']
nick = 'ju'
prefix_plugins = False
cmd_prefix='&'
bot = pinhook.bot.Bot(
channels,
nick,
'localhost',
ops=['jmjl'],
ns_pass='ju {}'.format(config['password']),
#ns_pass=config['password'],
nickserv='nickserv',
cmd_prefix=cmd_prefix,
use_prefix_for_plugins=prefix_plugins
)
bot.start()