aboutsummaryrefslogtreecommitdiffstats
path: root/bin/dbolla
diff options
context:
space:
mode:
Diffstat (limited to 'bin/dbolla')
-rwxr-xr-xbin/dbolla7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/dbolla b/bin/dbolla
index 78fe482..6c0b573 100755
--- a/bin/dbolla
+++ b/bin/dbolla
@@ -4,6 +4,8 @@ import asyncio
4import datetime 4import datetime
5import functools 5import functools
6import logging.config 6import logging.config
7import os
8
7 9
8from warmachine.config import Config 10from warmachine.config import Config
9from warmachine.connections.irc import AioIRC 11from warmachine.connections.irc import AioIRC
@@ -53,6 +55,8 @@ class Bot(object):
53 self.load_plugin('warmachine.addons.giphy.GiphySearch') 55 self.load_plugin('warmachine.addons.giphy.GiphySearch')
54 self.load_plugin('warmachine.addons.standup.StandUpPlugin') 56 self.load_plugin('warmachine.addons.standup.StandUpPlugin')
55 57
58 # TODO: Ensure the config directory has been created
59
56 def start(self): 60 def start(self):
57 for connection in self.connections: 61 for connection in self.connections:
58 t = asyncio.ensure_future(connection.connect()) 62 t = asyncio.ensure_future(connection.connect())
@@ -64,6 +68,9 @@ class Bot(object):
64 self.connections[connection] = {} 68 self.connections[connection] = {}
65 69
66 def on_connect(self, connection, task): 70 def on_connect(self, connection, task):
71 for p in self.loaded_plugins:
72 if hasattr(p, 'on_connect'):
73 p.on_connect(connection)
67 asyncio.ensure_future(self.process_message(connection)) 74 asyncio.ensure_future(self.process_message(connection))
68 75
69 async def process_message(self, connection): 76 async def process_message(self, connection):