From 2d45be2bf8810062fbdbc052c3275b140d5c50df Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 29 Sep 2018 14:06:33 +0200 Subject: Add simple IRC bot chromebot is back! Dropping sopel, because it does not work well with asyncio. --- crocoite/cli.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'crocoite/cli.py') diff --git a/crocoite/cli.py b/crocoite/cli.py index 3f5904c..dadfc45 100644 --- a/crocoite/cli.py +++ b/crocoite/cli.py @@ -107,3 +107,22 @@ def recursive (): loop.run_until_complete(controller.run ()) loop.close() +def irc (): + from configparser import ConfigParser + from .irc import Bot + + config = ConfigParser () + config.read ('chromebot.ini') + s = config['irc'] + + bot = Bot ( + host=s.get ('host'), + port=s.getint ('port'), + ssl=s.getboolean ('ssl'), + nick=s.get ('nick'), + channels=[s.get ('channel')], + tempdir=s.get ('tempdir'), + destdir=s.get ('destdir')) + bot.loop.create_task(bot.connect()) + bot.loop.run_forever() + -- cgit v1.2.3