rate limit so we don't get kicked
This commit is contained in:
parent
ec6a3dc90e
commit
e129b0c0d9
1 changed files with 6 additions and 1 deletions
|
@ -42,10 +42,15 @@ class RtmBot(object):
|
|||
plugin.do(function_name, data)
|
||||
def output(self):
|
||||
for plugin in self.bot_plugins:
|
||||
limiter = False
|
||||
for output in plugin.do_output():
|
||||
channel = self.slack_client.server.channels.find(output[0])
|
||||
if channel != None:
|
||||
if channel != None and output[1] != None:
|
||||
if limiter == True:
|
||||
time.sleep(1)
|
||||
limiter = False
|
||||
channel.send_message("{}".format(output[1]))
|
||||
limiter = True
|
||||
else:
|
||||
raise UnknownChannel
|
||||
def crons(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue