added new config values to setup.py and example-config.json

Signed-off-by: SpagettiFisch <johmewu@gmail.com>
This commit is contained in:
SpagettiFisch 2024-06-14 14:56:49 +02:00
parent 82a21ec8c3
commit 4a091fd9fd
2 changed files with 23 additions and 15 deletions

View file

@ -4,8 +4,8 @@
"token": "discord bot token", "token": "discord bot token",
"pterodactyl_domain": "https://panel.pterodactyl.com/", "pterodactyl_domain": "https://panel.pterodactyl.com/",
"pterodactyl_apikey": "user api key", "pterodactyl_apikey": "user api key",
"guild_id": "169256939211980800", "mod_roles": [273600757264023553, 1168422950685384765, 286965023249793046],
"guild_admin_id": "169256939211980800" "admin_roles": [807336816863739925]
} }
] ]
} }

View file

@ -13,27 +13,35 @@ if not path.exists('config/config.json'):
jsonstructure = {} # Platzhalter jsonstructure = {} # Platzhalter
jsonstructure['discord'] = [] jsonstructure['discord'] = []
wronginput = False wronginput = False
print("Möchtest du das automatisierte Setup nutzen? y/n") print("Do you want to use the automated setup? Y/n")
input1 = input() input1 = input()
if input1.lower().strip() == 'y': if input1.lower().strip() == 'y':
print("Bitte geben Sie den Token ein:") print("Please insert your token:")
token = input() token = input()
print("Bitte geben Sie die Pterodactyl Domain ein (Form: https://example.com/ | optional):") print("Please insert your pterodactyl domain here (Format: https://example.com/ | optional):")
pterodactyl_domain = input() pterodactyl_domain = input()
print("Bitte geben Sie den Pterodactyl API Key ein (optional):") print("Please insert your pterodactyl API key (optional):")
pterodactyl_api_key = input() pterodactyl_api_key = input()
print("Bitte geben Sie die Guild ID ein:") print("Please state how many moderator roles you are using (Roles which are able to modify the whitelist or user):")
guild_id = input() mod_count = input()
print("Bitte geben Sie die ID des Admin Channels ein:") mod_roles = []
guild_admin_id = input() print("Please insert the id of every moderating role:")
for i in mod_count:
mod_roles.append(input())
print("Please state how many admin roles you are using (Roles which are able to stop the bot):")
admin_count = input()
admin_roles = []
print("Please insert the id of every admin role:")
for i in admin_count:
admin_roles.append(input())
jsonstructure['discord'].append({ jsonstructure['discord'].append({
'token': token, 'token': token,
'pterodactyl_domain': pterodactyl_domain, 'pterodactyl_domain': pterodactyl_domain,
'pterodactyl_apikey': pterodactyl_api_key, 'pterodactyl_apikey': pterodactyl_api_key,
'guild_id': guild_id, 'mod_roles': mod_roles,
'guild_admin_id': guild_admin_id 'admin_roles': admin_roles
}) })
elif input1.lower().strip() == 'n': elif input1.lower().strip() == 'n':
@ -42,8 +50,8 @@ if not path.exists('config/config.json'):
'token': 'Platzhalter', 'token': 'Platzhalter',
'pterodactyl_domain': '', 'pterodactyl_domain': '',
'pterodactyl_apikey': '', 'pterodactyl_apikey': '',
'guild_id': '', 'mod_roles': [],
'guild_admin_id': '' 'admin_roles': []
}) })
else: else:
@ -55,7 +63,7 @@ if not path.exists('config/config.json'):
os.mkdir('config') os.mkdir('config')
with open('config/config.json', 'w') as outfile: with open('config/config.json', 'w') as outfile:
json.dump(jsonstructure, outfile, indent=4) json.dump(jsonstructure, outfile, indent=4)
print("Config erfolgreich erzeugt") print("Config created succesfully")
if not os.path.exists('whitelist/paths.txt'): if not os.path.exists('whitelist/paths.txt'):
if not os.path.exists('whitelist'): if not os.path.exists('whitelist'):