PEP in utils

This commit is contained in:
Nikolaj
2021-06-16 14:12:21 +02:00
parent 8c253aca3d
commit b68d62cf6c
137 changed files with 1159 additions and 1251 deletions

30
main.py Normal file
View File

@ -0,0 +1,30 @@
"""Runs the Gwendolyn bot."""
import platform # Used to test if the bot is running on windows, in
# order to fix a bug with asyncio
import asyncio # used to set change the loop policy if the bot is
# running on windows
from gwendolyn import Gwendolyn
from gwendolyn.utils import make_files
def main():
"""Starts the bot"""
if platform.system() == "Windows":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
# Creates the required files
make_files()
# Creates the Bot
bot = Gwendolyn()
try:
# Runs the whole shabang
bot.run(bot.credentials["token"])
except Exception as exception: # pylint: disable=broad-except
bot.log(bot.long_strings[f"Can't log in: {repr(exception)}"])
if __name__ == "__main__":
main()