From a888d365f9df99d3c68c7e4926fba432a8244619 Mon Sep 17 00:00:00 2001 From: Jacob Henry Date: Tue, 9 Oct 2018 18:50:29 -0400 Subject: [PATCH] Prevented dry firing of nagbot --- job_nagger.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/job_nagger.py b/job_nagger.py index 354361f..d94a5f0 100644 --- a/job_nagger.py +++ b/job_nagger.py @@ -35,6 +35,10 @@ def nag_callback(slack, msg, match): # Filter to day jobs = [j for j in jobs if j.day == day] + # If no jobs found, somethings up. Probably mispelled day. + if not jobs: + slack_util.reply(slack, msg, "No jobs found. Check that the day is spelled correctly, with no extra symbols", in_thread=True) + # Nag each response = "Do yer jerbs! They are as follows:\n" for job in jobs: