diff --git a/__pycache__/bot.cpython-36.pyc b/__pycache__/bot.cpython-36.pyc index 4a028b7..ef09e22 100755 Binary files a/__pycache__/bot.cpython-36.pyc and b/__pycache__/bot.cpython-36.pyc differ diff --git a/__pycache__/librarySetup.cpython-36.pyc b/__pycache__/librarySetup.cpython-36.pyc new file mode 100755 index 0000000..53f027b Binary files /dev/null and b/__pycache__/librarySetup.cpython-36.pyc differ diff --git a/__pycache__/setup.cpython-36.pyc b/__pycache__/setup.cpython-36.pyc index 2a13203..fe7043b 100755 Binary files a/__pycache__/setup.cpython-36.pyc and b/__pycache__/setup.cpython-36.pyc differ diff --git a/configure.py b/configure.py new file mode 100755 index 0000000..2e3b8e0 --- /dev/null +++ b/configure.py @@ -0,0 +1,5 @@ +def configure(): + + + +configure() \ No newline at end of file diff --git a/librarySetup.py b/librarySetup.py new file mode 100755 index 0000000..adf3737 --- /dev/null +++ b/librarySetup.py @@ -0,0 +1,23 @@ +def checkLibraries(): + + import getpass + import os + + try: + os.system("pip3 -V") + except: + os.system("sudo apt install python3-pip") + try: + import discord + except: + try: + os.system("python3 -m pip install -U discord.py") + except: + os.system("py3 -m pip install -U discord.py") + try: + import mcstatus + except: + os.system("pip3 install mcstatus") + os.system("pip3 install status") + +checkLibraries() \ No newline at end of file diff --git a/run.py b/run.py index 0f5147e..b832d99 100755 --- a/run.py +++ b/run.py @@ -1,11 +1,16 @@ def run(): + import librarySetup + librarySetup.checkLibraries() + import setup import bot import online import os + if not os.path.isfile('.env'): setup.environment() + os.system("python3 bot.py") run() \ No newline at end of file diff --git a/setup.py b/setup.py index 81c4b4f..710379d 100755 --- a/setup.py +++ b/setup.py @@ -1,24 +1,24 @@ def environment(): import os.path - '''Checks to see if there is an environment file''' - if os.path.isfile('.env'): + '''Prevents overwriting of the environment file''' + if os.path.isfile('.env'): #Checks to see if there is an environment file overwrite = input("Would you like to overwrite your current credentials? (y/n)") - overwrite = overwrite.lower() + overwrite = overwrite.lower() #Makes the input string lowercase if overwrite == "y" or overwrite == "yes": print("Creating new credientials... \n") else: - return + return #Exit function '''Gets information''' token = input("Input your bot token here > ") serverIP = input("Input your server URL/IP here > ") port = input("Input your bot port here (If you don't know it, leave blank) > ") if port == "": - port = "25565" + port = "25565" #Default Minecraft server port '''Concantinate into a string''' - data = "TOKEN={}\nSERVER={}\nPORT={}".format(token,serverIP,port) + data = "TOKEN={}\nSERVER={}\nPORT={}".format(token,serverIP,port) #Sets the format of the data '''Write data to the .env file''' creds = open(".env", "w") @@ -35,6 +35,7 @@ def environment(): return else: tryAgain = ("Error writing data. \n Try again? (y/n) > ") + tryAgain = tryAgain.lower() #Makes the input string lowercase if tryAgain == "y" or tryAgain == "yes": environment() else: