You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
569 B
25 lines
569 B
"""Start the IRC bot via Django management command."""
|
|
import logging
|
|
import signal
|
|
|
|
from django.core.management import BaseCommand
|
|
|
|
from ircbot.bot import IRCBot
|
|
|
|
log = logging.getLogger('ircbot')
|
|
|
|
|
|
class Command(BaseCommand):
|
|
"""Provide the command to start the IRC bot.
|
|
|
|
This will run until the bot disconnects and shuts down.
|
|
"""
|
|
|
|
help = "Start the IRC bot"
|
|
|
|
def handle(self, *args, **options):
|
|
"""Start the IRC bot and spin forever."""
|
|
irc = IRCBot()
|
|
signal.signal(signal.SIGINT, irc.sigint_handler)
|
|
irc.start()
|