-
-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (21 loc) · 967 Bytes
/
main.py
File metadata and controls
28 lines (21 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from discordgsm import Logger, __version__, env
if __name__ == "__main__":
Logger.info(f"Started Discord Game Server Monitor {__version__}")
Logger.info(
"Thank you for using DiscordGSM, you may consider sponsoring us ♥. Github Sponsors: https://github.com/sponsors/DiscordGSM"
)
token = str(env("APP_TOKEN")).strip()
items = token.split(".")
# A valid token should contains 2 dots and 3 items
if len(items) != 3:
Logger.critical(
"Improper token has been passed, please change APP_TOKEN to a valid token. Learn more: https://discordgsm.com/guide/how-to-get-a-discord-bot-token"
)
exit(1)
hmac_hide = "*" * len(items[2]) # Hide the secret
Logger.debug(f"Static token: {items[0]}.{items[1]}.{hmac_hide}")
# Run the bot
from discordgsm.main import client, exit_signal
client.run(token)
exit_signal.set()
Logger.info("Stopping Discord Game Server Monitor...")