account for discord rate limiting
This commit is contained in:
parent
6e9234b3e0
commit
897c82ba28
@ -98,9 +98,10 @@ class GuildsView(View):
|
||||
)
|
||||
|
||||
content = response.json()
|
||||
print(response, content)
|
||||
status = response.status_code
|
||||
print(response, content, status)
|
||||
|
||||
return JsonResponse(content, safe=False)
|
||||
return JsonResponse(content, safe=False, status=status)
|
||||
|
||||
|
||||
class GuildChannelsView(View):
|
||||
@ -122,23 +123,4 @@ class GuildChannelsView(View):
|
||||
|
||||
class SaveGuildView(View):
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
|
||||
guild_id = request.GET.get("id")
|
||||
|
||||
if guild_id:
|
||||
return SavedGuilds.objects.filter(id=guild_id)
|
||||
|
||||
return SavedGuilds.objects.all()
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
|
||||
data = request.POST
|
||||
|
||||
guild = SavedGuilds.objects.get_or_create(
|
||||
id=data["id"],
|
||||
name=data["name"],
|
||||
icon=data["icon"]
|
||||
)
|
||||
|
||||
return JsonResponse(data)
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user