Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
token = ""
path = "C:\\Program Files (x86)\\World of Warcraft"
path = ""
chat_id = ""
7 changes: 3 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -26,11 +27,9 @@ def load_config():

return config


def main():
config = load_config()
monitor(config)


if __name__ == "__main__":
main()
4 changes: 2 additions & 2 deletions message.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import requests

import datetime

def get_chat_id(token):
url = f"https://api.telegram.org/bot{token}/getUpdates"
Expand All @@ -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