use main
This commit is contained in:
parent
60db6886c1
commit
9b575219ca
20
app.py
20
app.py
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user