aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.org4
-rw-r--r--warmachine/connections/slack.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/README.org b/README.org
index b317e13..b9dba73 100644
--- a/README.org
+++ b/README.org
@@ -34,7 +34,7 @@ tasks to be run later.
34The directory to store any configuration files and other junk in. 34The directory to store any configuration files and other junk in.
35** ~self.log~ 35** ~self.log~
36This is a logger that you should use when logging messages. 36This is a logger that you should use when logging messages.
37** ~recv_msg(channel, message)~ 37** ~self.recv_msg(channel, message)~
38~recv_msg~ is the only required method for a plugin. It is called for every 38~recv_msg~ is the only required method for a plugin. It is called for every
39plugin every time a connection receives a message. It takes the arguments 39plugin every time a connection receives a message. It takes the arguments
40~connection~ and ~message~. ~connection~ is the Connection object which allows 40~connection~ and ~message~. ~connection~ is the Connection object which allows
@@ -71,7 +71,7 @@ async def recv_msg(connection, message):
71 # Repeat the remainder of the received message 71 # Repeat the remainder of the received message
72 await connection.say(msg_to_repeat, message['channel']) 72 await connection.say(msg_to_repeat, message['channel'])
73#+END_SRC 73#+END_SRC
74** ~on_connect(connection)~ 74** ~self.on_connect(connection)~
75This method is called when a connection successfully connects and takes the 75This method is called when a connection successfully connects and takes the
76single argument ~connection~. Use this method to do any start up initialization 76single argument ~connection~. Use this method to do any start up initialization
77you may want to do such as create configuration files that don't exist yet. 77you may want to do such as create configuration files that don't exist yet.
diff --git a/warmachine/connections/slack.py b/warmachine/connections/slack.py
index 07e026c..10b6354 100644
--- a/warmachine/connections/slack.py
+++ b/warmachine/connections/slack.py
@@ -58,8 +58,8 @@ class SlackWS(Connection):
58 try: 58 try:
59 message = json.loads(await self.ws.recv()) 59 message = json.loads(await self.ws.recv())
60 except websockets.ConnectionClosed as e: 60 except websockets.ConnectionClosed as e:
61 self.log.error('Connection Closed: {}'.format(e)) 61 self.log.error('{}'.format(e))
62 while not self.connect(): 62 while not await self.connect():
63 self.error('Trying to reconnect...') 63 self.error('Trying to reconnect...')
64 await asyncio.sleep(300) 64 await asyncio.sleep(300)
65 return 65 return