diff --git a/bot.py b/bot.py index 84a1706..61fc842 100644 --- a/bot.py +++ b/bot.py @@ -3,6 +3,7 @@ import discord from discord.ext import commands, tasks import requests from bs4 import BeautifulSoup +import datetime # Read token from file f = open("token.txt", "r") @@ -20,6 +21,8 @@ la_servers = {} client = discord.Client() def get_servers_status(): + print("Getting servers", end = " ") + print(str(datetime.datetime.now())) r = requests.get("https://www.playlostark.com/en-us/support/server-status") soup = BeautifulSoup(r.content, features = "html.parser") @@ -120,7 +123,12 @@ async def check_status(): for sub in globalList["subs"]: if sub["Server"] == curr["Server"]: channel = client.get_channel(sub["Channel"]) - await channel.send(curr["Server"] + " changed status to " + curr["Status"]) + print("Channel", end = " ") + print(sub["Channel"]) + print("Server", end = " ") + print(sub["Server"]) + if channel is not None: + await channel.send(curr["Server"] + " changed status to " + curr["Status"]) globalList["la_servers"] = curr_status client.run(token)