move IRC server settings to database

this is the first step in trying to get the bot to support multiple
servers with different channels, countdown triggers, and so on

this also ends up affecting some configuration around:
* dispatch
* markov
* admin privmsg form
This commit is contained in:
2021-04-25 08:59:01 -05:00
parent 44d8b7db00
commit 6136127c5f
12 changed files with 158 additions and 73 deletions

View File

@@ -17,8 +17,13 @@ class Command(BaseCommand):
help = "Start the IRC bot"
def add_arguments(self, parser):
"""Add arguments to the bot startup."""
parser.add_argument('server_name')
def handle(self, *args, **options):
"""Start the IRC bot and spin forever."""
irc = IRCBot()
self.stdout.write(self.style.NOTICE(f"Starting up {options['server_name']} bot"))
irc = IRCBot(options['server_name'])
signal.signal(signal.SIGINT, irc.sigint_handler)
irc.start()