✨ reworking a bunch of stuff
This commit is contained in:
17
main.py
17
main.py
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user