Esempio n. 1
0
	def on_server_event_modify_explanations(self, user, data):
		commands.static.modify_explanations(data)
		bot.compile()
Esempio n. 2
0
				}]
		return ret
bot = LRRBot()

def init_logging():
	logging.basicConfig(level=config['loglevel'], format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s")
	if config['logfile'] is not None:
		fileHandler = logging.FileHandler(config['logfile'], 'a', 'utf-8')
		fileHandler.formatter = logging.root.handlers[0].formatter
		logging.root.addHandler(fileHandler)

if __name__ == '__main__':
	# Fix module names
	import sys
	sys.modules["lrrbot"] = sys.modules["__main__"]

	init_logging()

	import commands
	bot.compile()

	try:
		log.info("Bot startup")
		bot.start()
	except (KeyboardInterrupt, SystemExit):
		pass
	finally:
		log.info("Bot shutdown")
		logging.shutdown()