bot permissions view (for later)

will use to check whether the bot has permissions in any given server
This commit is contained in:
Corban-Lee Jones 2024-09-26 16:47:15 +01:00
parent f4c0f0b0f3
commit 20e713d8df
2 changed files with 9 additions and 3 deletions

View File

@ -3,9 +3,10 @@
from django.urls import path
from django.contrib.auth.decorators import login_required
from .views import IndexView, GuildsView
from .views import IndexView, GuildsView, CheckBotPermissionView
urlpatterns = [
path("", login_required(IndexView.as_view()), name="index"),
path("generate-servers/", GuildsView.as_view(), name="generate-servers")
path("generate-servers/", GuildsView.as_view(), name="generate-servers"),
path("bot-permissions/", CheckBotPermissionView.as_view(), name="bot-permissions")
]

View File

@ -47,7 +47,6 @@ class GuildsView(View):
return JsonResponse(cleaned_guild_data, safe=False)
@staticmethod
@sync_to_async
def get_user_access_token(user: DiscordUser) -> str:
@ -94,3 +93,9 @@ class GuildsView(View):
await member.adelete()
except ServerMember.DoesNotExist:
pass
class CheckBotPermissionView(View):
async def get(self, request, *args, **kwargs):
return JsonResponse({"test": ""})