diff --git a/src/launcher/main.py b/src/launcher/main.py index 141aeb5..a7b0467 100644 --- a/src/launcher/main.py +++ b/src/launcher/main.py @@ -8,13 +8,19 @@ SCRIPTS = requests.get('https://raw.githubusercontent.com/'+REPO+'/main/data/scripts.json').json() # Title -print('Launcher version 0.1b'+Fore.RED+''' +def title(): + if os.name == 'nt': + os.system('cls') + else: + os.system('clear') + print('Launcher version 0.2b'+Fore.RED+''' ____ _ _ ____ _ _ | _ \(_)___ ___ ___ _ __ __| | / ___| ___ _ __(_)_ __ | |_ ___ | | | | / __|/ __/ _ \| '__/ _` | \___ \ / __| '__| | '_ \| __/ __| | |_| | \__ \ (_| (_) | | | (_| | ___) | (__| | | | |_) | |_\__ \\ |____/|_|___/\___\___/|_| \__,_| |____/ \___|_| |_| .__/ \__|___/ ''' + Fore.RESET + 'created by ' + REPO.split('/')[0] + (' ' * (33 - len(REPO.split('/')[0]))) + Fore.RED + '|_|\n' + Fore.RESET) +title() token = input("\nPlease enter your Discord token (this wont be shared or saved anywhere): ") # Auto updater @@ -46,10 +52,13 @@ def download_scripts(): # Command line scripts = os.listdir(DIR+'/scripts/') -print("Commands:\n - scripts\n - run [id]\n") +print("Commands:\n - help\n - scripts\n - run [id]\n - exit\n") while True: command = input('> ') - if command.split(' ')[0] == 'scripts': + if len(command.rsplit(' ', 1)) > 1: + args = command.rsplit(' ', 1)[1] + command = command.rsplit(' ', 1)[0] + if command == 'scripts': print('\nScripts:') i = 1 for script in scripts: @@ -58,10 +67,15 @@ def download_scripts(): print(f' {i}) {script[:-3]} - {desc}') i += 1 print("") - elif command.split(' ')[0] == 'run': + elif command == 'exit': + exit(0) + elif command == 'help': + print("\nCommands:\n - help\n - scripts\n - run [id]\n - exit\n") + elif command == 'clear': + title() + elif command == 'run': try: - command = command.split(' ')[1] - script = scripts[len(scripts)-i+int(command)] + script = scripts[len(scripts)-i+int(args)] print(f'\nSelected {script}') params = {"token":token} iparams = __import__('scripts.'+script[:-3], fromlist=[None]).params @@ -72,4 +86,4 @@ def download_scripts(): __import__('scripts.'+script[:-3], fromlist=[None]).run(**params) print("\nDone!\n") except: - print("\nUnable to run. Try again?\n") \ No newline at end of file + print("\nFailed.\n") \ No newline at end of file diff --git a/src/scripts/friend-invite.py b/src/scripts/friend-invite.py index 2d34ae8..97edb61 100644 --- a/src/scripts/friend-invite.py +++ b/src/scripts/friend-invite.py @@ -9,7 +9,7 @@ def run(token): headers = { "accept" : "*/*", "accept-encoding" : "gzip, deflate", "accept-language" : "en-US", "authorization" : token, "dnt" : "1", "referer" : "https://discord.com/channels/@me", "sec-ch-ua-mobile" : "?0", "sec-ch-ua-platform" : "\"Windows\"", "sec-fetch-dest" : "empty", "sec-fetch-mode" : "cors", "sec-fetch-site" : "same-origin", "user-agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36", "x-debug-options" : "bugReporterEnabled", "x-discord-locale" : "en-US" } invite = requests.post("https://discord.com/api/v9/users/@me/invites", headers=headers, json={}).json() - print(f"Friend invite generated!\nLink: https://discord.gg/{invite['code']}\nThis invite has a maximum of 5 uses.") + print(f"\nFriend invite generated!\nLink: https://discord.gg/{invite['code']}\nThis invite has a maximum of 5 uses.") if __name__ == "__main__": config = {}