import kirc import commands irc = kirc.Irc('Rusnet', 'irc.run.net', 6660, 'Coxy_t', 'bot', 'kupp bot', 'utf-8') irc.connect(100, 900) irc.join('#16bits') irc.join('###kupp_tests') c = commands.CommandsCore(irc, '.') ready = select.select([sys.stdin], [], [], timeout)[0] while True: try: msgs = irc.wait_data() if msgs: for msg in msgs.split('\r\n'): if msg: irc.maintenance(msg) kirc.pretty_print(msg.strip()) c.search(msg) except KeyboardInterrupt: irc.quit('Im part, but it doesnt mean that i crash') except kirc.IrcConnectionError: irc.reconnect(100, 900)
import kirc import sys import bot import time nick = 'Coxy' irc = kirc.Irc('Rusnet', 'irc.run.net', 9996, nick, 'bot', 'kupp bot', 'utf-8', ssl_enable=True) irc.connect(100, 100000) irc.send('MODE %s +x' % nick) irc.join('#16bits') irc.join('#16bit') c = bot.Bot(irc, '.') def main_loop(): while True: try: msgs = irc.wait_data() if msgs: for msg in msgs.split('\r\n'): if msg: irc.maintenance(msg) kirc.pretty_print(msg.strip())