2018-06-13 00:16:19 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
# World Time, a Discord bot. Displays user time zones.
|
|
|
|
# - https://github.com/Noikoio/WorldTime
|
|
|
|
# - https://bots.discord.pw/bots/447266583459528715
|
|
|
|
|
|
|
|
# Using discord.py rewrite. To install:
|
|
|
|
# pip install -U git+https://github.com/Rapptz/discord.py@rewrite
|
|
|
|
|
|
|
|
# And yes, this code sucks. I don't know Python all too well.
|
|
|
|
|
|
|
|
from discord import Game
|
2018-08-24 05:00:40 +00:00
|
|
|
from client import WorldTime
|
2018-08-02 00:40:41 +00:00
|
|
|
import settings
|
2018-06-13 00:16:19 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
try:
|
2018-08-02 00:40:41 +00:00
|
|
|
if settings.BotToken == '': raise AttributeError() # Cover both scenarios: variable doesn't exist, or variable is empty
|
|
|
|
except AttributeError:
|
|
|
|
print("Bot token not set. Will not continue.")
|
2018-06-13 00:16:19 +00:00
|
|
|
exit()
|
|
|
|
|
|
|
|
client = WorldTime(activity=Game('tz.help'))
|
2018-08-02 00:40:41 +00:00
|
|
|
client.run(settings.BotToken)
|