itte/run.py

23 lines
455 B
Python
Raw Normal View History

from time import sleep
2018-09-12 20:01:24 +00:00
import config as cfg
from irc import IRC
from ramen import Ramen
2018-09-12 20:01:24 +00:00
irc = IRC()
irc.is_debug(cfg.debug)
socket = irc.connect(cfg.server, cfg.bot_nick)
irc.join_channels(cfg.channels)
ramen = Ramen()
# Have run.py and ramen.py share the same socket connection
ramen.attach(socket)
2018-09-12 20:01:24 +00:00
while 1:
sleep(2)
data = irc.receive(debug=cfg.debug)
irc.keep_alive(data)
for chan in cfg.channels:
ramen.handle(chan, data)