collapsing all of dr_botzo one directory
This commit is contained in:
0
ircbot/management/commands/__init__.py
Normal file
0
ircbot/management/commands/__init__.py
Normal file
27
ircbot/management/commands/runircbot.py
Normal file
27
ircbot/management/commands/runircbot.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""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()
|
||||
Reference in New Issue
Block a user