From 47eaac72202cfa11b8b1df022201ed23637d2e5b Mon Sep 17 00:00:00 2001 From: jowj Date: Sun, 7 Oct 2018 14:41:08 -0500 Subject: [PATCH] Update monitoring function to include channel declaration. --- mojojojo-bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mojojojo-bot.py b/mojojojo-bot.py index bb82e6e..d11937b 100644 --- a/mojojojo-bot.py +++ b/mojojojo-bot.py @@ -131,11 +131,11 @@ def react_to_message(reaction): def react_to_monitoring(): results_file = Path("/results.json") if results_file.is_file(): - results_file = open("/results.json","r") - for line in results_file: + open_file = open("/results.json","r") + for line in open_file: slack_client.api_call( "chat.postMessage", - get_channel_ID("bots-like-gaston"), + channel = get_channel_ID("bots-like-gaston"), text=line ) os.remove("/results.json") @@ -162,7 +162,7 @@ if __name__ == "__main__": if command: handle_command(command, channel) if results_file.is_file(): - logging.info("the if statement passed!") + logging.info("results_file ifstatement passed!") react_to_monitoring() if reactable_message(event): channel = event['channel']