WorldTime/worldtime.py

24 lines
753 B
Python
Raw Normal View History

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
# Dependencies (install via pip or other means):
2019-09-07 20:03:30 +00:00
# pytz, psycopg2, discord.py
# How to install the latter: pip install -U git+https://github.com/Rapptz/discord.py
2018-06-13 00:16:19 +00:00
from discord import Game
2018-08-24 05:00:40 +00:00
from client import WorldTime
import settings
2018-06-13 00:16:19 +00:00
if __name__ == '__main__':
try:
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'))
client.run(settings.BotToken)