fulvia/run.py

32 lines
595 B
Python
Raw Normal View History

2018-03-16 03:13:43 -04:00
#!/usr/bin/env python3
"""
Initializes the bot.
"""
import os
from twisted.internet import reactor
from bot import FulviaFactory
from config import Config
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(
description="Fulvia IRC Bot")
parser.add_argument(
"-c",
"--config",
help="Use a specific config file.")
args = parser.parse_args()
if not args.config:
args.config = "default.cfg"
config = Config(args.config)
server = config.core.server
port = int(config.core.port)
reactor.connectTCP(server, port, FulviaFactory(config))
reactor.run()