Skip to content

Commit

Permalink
Launcher update 0.3
Browse files Browse the repository at this point in the history
Updated launcher (last time for today I promise) and added newline to the friend invite script
  • Loading branch information
mov-ebx committed Dec 11, 2022
1 parent 40e9703 commit 66ddfe8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
28 changes: 21 additions & 7 deletions src/launcher/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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")
print("\nFailed.\n")
2 changes: 1 addition & 1 deletion src/scripts/friend-invite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down

0 comments on commit 66ddfe8

Please sign in to comment.