Skip to content

Commit

Permalink
Limit reactions to one message per channel per two hours (v4)
Browse files Browse the repository at this point in the history
Ken Lowe committed May 27, 2020
1 parent bbb5e6e commit 5a6dd33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
raise Exception('no linkbots defined')
SLACK_CLIENT = slack.WebClient(app.config['SLACK_BOT_TOKEN'])
WEBHOOK_CLIENT = RequestLogger()
DUPLICATION_DELAY = app.config.get('DUPLICATION_DELAY', 2 * 60 * 60)
DUPLICATION_DELAY = app.config.get('DUPLICATION_DELAY', 7.5 * 60)

doneThat = {}

@@ -126,9 +126,9 @@ def process_command(command):
def links_from_text(text, channel):
"""Search for matches and post any to the original channel."""
now = time.time()
for key in doneThat:
if doneThat[key] < now:
del doneThat[key]
beenThere = [key for key in doneThat if doneThat[key] < now]
for key in beenThere:
del doneThat[key]
for bot in LINKBOTS:
for match in bot.match(text):
if channel:

0 comments on commit 5a6dd33

Please sign in to comment.