This repository has been archived on 2023-04-13. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
CloudBot/cloudbot.py
2013-10-02 19:35:44 +13:00

25 lines
564 B
Python

#!/usr/bin/env python
from core import bot
import os
import sys
import signal
# set up enviroment
os.chdir(sys.path[0] or '.') # do stuff relative to the install directory
print 'CloudBot2 <http://git.io/cloudbotirc>'
def exit_gracefully(signum, frame):
cloudbot.stop()
# store the original SIGINT handler
original_sigint = signal.getsignal(signal.SIGINT)
signal.signal(signal.SIGINT, exit_gracefully)
# create new bot object
cloudbot = bot.Bot()
cloudbot.logger.debug("Bot initalized, starting main loop.")
while cloudbot.running:
cloudbot.loop()