mirror of
https://github.com/parkervcp/eggs.git
synced 2025-01-26 18:33:05 +08:00
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
import subprocess
|
|
import asyncio
|
|
|
|
while True:
|
|
try:
|
|
import discord
|
|
from dotenv import load_dotenv
|
|
from pydactyl import PterodactylClient
|
|
import pytz
|
|
except ImportError as e:
|
|
if "discord" in str(e):
|
|
print("Module discord is niet gevonden en word nu geinstalleerd")
|
|
asyncio.sleep(5)
|
|
subprocess.run(["pip", "install", "-U", "py-cord[voice]"])
|
|
elif "dotenv" in str(e):
|
|
print("Module python-dotenv has not been found and is installing now")
|
|
asyncio.sleep(5)
|
|
subprocess.run(["pip", "install", "python-dotenv"])
|
|
elif "pydactyl" in str(e):
|
|
print("Module pydactyl has not been found and is installing now")
|
|
asyncio.sleep(5)
|
|
subprocess.run(["pip", "install", "py-dactyl"])
|
|
elif "pytz" in str(e):
|
|
print("Module pytz has not been found and is installing now")
|
|
asyncio.sleep(5)
|
|
subprocess.run(["pip", "install", "pytz"])
|
|
else:
|
|
print(f"Unknown Importerror: {e}")
|
|
break
|
|
else:
|
|
subprocess.run(["python", "bot.py"])
|
|
break
|