diff --git a/config.toml b/config.toml index 97ef3b5..a418abd 100644 --- a/config.toml +++ b/config.toml @@ -1,3 +1,3 @@ token = "" -path = "C:\\Program Files (x86)\\World of Warcraft" +path = "" chat_id = "" diff --git a/main.py b/main.py index 9cb687c..4985a4b 100644 --- a/main.py +++ b/main.py @@ -2,10 +2,11 @@ from monitor import monitor import toml import sys - +import os def load_config(): - config_location = "config.toml" + absolute_path = os.path.abspath(__file__) + config_location = os.path.dirname(absolute_path)+"\\config.toml" with open(config_location) as file: config = toml.load(file) # Make a dict of the config values @@ -26,11 +27,9 @@ def load_config(): return config - def main(): config = load_config() monitor(config) - if __name__ == "__main__": main() diff --git a/message.py b/message.py index 8ef03ff..7c2012d 100644 --- a/message.py +++ b/message.py @@ -1,5 +1,5 @@ import requests - +import datetime def get_chat_id(token): url = f"https://api.telegram.org/bot{token}/getUpdates" @@ -12,6 +12,6 @@ def get_chat_id(token): def send_message(token, chat_id): - message = "Your Solo Shuffle is ready." + message = f"""Your Solo Shuffle is ready now ({datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")})""" url = f"https://api.telegram.org/bot{token}/sendMessage?chat_id={chat_id}&text={message}" requests.get(url) # Send the message to the user