reworking a bunch of stuff

This commit is contained in:
Nikolaj
2024-10-28 13:05:06 +01:00
parent f21cbba726
commit bc59bf9b05
142 changed files with 1385 additions and 845 deletions

17
main.py
View File

@@ -1,30 +1,17 @@
"""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)}"])
bot.load_extension("gwendolyn.ext.misc")
bot.start("NzM4NzYwODkyNjczNTU2NTYy.GPjy55.xbYtH20UtCjOl87C-2DEPx2BwFWh2-xn1-9YnE")
if __name__ == "__main__":
main()