From 479d6a7145f0de9ca291e56962e65a95823f2c3c Mon Sep 17 00:00:00 2001 From: ceb515 Date: Thu, 15 Feb 2024 14:06:49 -0500 Subject: [PATCH] Add threading to allow the watchdog to run in the background --- pagebot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pagebot.py b/pagebot.py index 02cbee8..e466772 100644 --- a/pagebot.py +++ b/pagebot.py @@ -4,6 +4,7 @@ import os import subprocess import time import secrets_file +import threading from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler import speech_recognition as sr @@ -116,7 +117,8 @@ if __name__ == "__main__": observer.start() ## Launch TTD - launch_and_watch(secrets_file.ttd_path) + watchdog_thread = threading.Thread(target=launch_and_watch, args=(secrets_file.ttd_path,)) + watchdog_thread.start() ## initialize discord intents = discord.Intents.default()