Added token to SettingsAPI
parent
23739b31f9
commit
a6817a710c
13
api/views.py
13
api/views.py
|
@ -38,7 +38,7 @@ class CommandAPI(View):
|
||||||
|
|
||||||
if check_token(get, commands_perm=True):
|
if check_token(get, commands_perm=True):
|
||||||
if command.lower() == "commands":
|
if command.lower() == "commands":
|
||||||
return JsonResponse(command.commands_dict)
|
return JsonResponse(commands.command_dict)
|
||||||
else:
|
else:
|
||||||
return run_command(get, command, "GET")
|
return run_command(get, command, "GET")
|
||||||
else:
|
else:
|
||||||
|
@ -61,12 +61,15 @@ class CommandAPI(View):
|
||||||
|
|
||||||
class SettingsAPI(View):
|
class SettingsAPI(View):
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
|
if check_token(request, command_perm=True):
|
||||||
response = {
|
response = {
|
||||||
"BOT_PREFIX": getattr(settings, 'BOT_PREFIX', '?'),
|
"BOT_PREFIX": getattr(settings, 'GEOFFREY_BOT_PREFIX', '?'),
|
||||||
"ERROR_USERS": getattr(settings, 'ERROR_USERS', []),
|
"ERROR_USERS": getattr(settings, 'GEOFFREY__BOT_ERROR_USERS', []),
|
||||||
"MOD_RANK": getattr(settings, 'MOD_RANK', []),
|
"MOD_RANKS": getattr(settings, 'GEOFFREY_BOT_MOD_RANK', []),
|
||||||
"DEFAULT_STATUS": getattr(settings, 'DEFAULT_STATUS', 'sed')
|
"STATUS": getattr(settings, 'GEOFFREY_BOT_STATUS', 'sed')
|
||||||
}
|
}
|
||||||
|
else:
|
||||||
|
response = {}
|
||||||
|
|
||||||
return JsonResponse(response)
|
return JsonResponse(response)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue