This commit is contained in:
Giulio De Pasquale 2021-06-21 17:28:00 +01:00
parent 60db6886c1
commit 9b575219ca

20
app.py
View File

@ -38,12 +38,6 @@ load_dotenv()
# load env vars from .env file
token = getenv("TOKEN")
if not token:
print("Could not load environmental variables. Make sure TOKEN is set in .env")
exit(0)
bot = discum.Client(token=token, log=False)
########################################
@ -154,5 +148,15 @@ def on_message(resp):
check_urls(urls)
print("Initialized.")
bot.gateway.run(auto_reconnect=True)
def main():
if not token:
print("Could not load environmental variables. Make sure TOKEN is set in .env")
exit(0)
print("Initialized.")
bot.gateway.run(auto_reconnect=True)
if __name__ == "__main__":
main()