diff options
author | 2020-10-27 01:51:55 +0000 | |
---|---|---|
committer | 2020-10-27 01:51:55 +0000 | |
commit | b63d79ac0f663d2062082d8cccf7dc0e072ceeb1 (patch) | |
tree | 59e6f4e8f56b996b53c88b05747411b4cb5872bb /pydis_site | |
parent | Add message block query (diff) |
Update viewset to include activity_blocks response item
Diffstat (limited to 'pydis_site')
-rw-r--r-- | pydis_site/apps/api/viewsets/bot/user.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pydis_site/apps/api/viewsets/bot/user.py b/pydis_site/apps/api/viewsets/bot/user.py index 5205dc97..79f90163 100644 --- a/pydis_site/apps/api/viewsets/bot/user.py +++ b/pydis_site/apps/api/viewsets/bot/user.py @@ -110,7 +110,9 @@ class UserViewSet(ModelViewSet): #### Response format >>> { ... "verified_at": "2020-10-06T21:54:23.540766", - ... "total_messages": 2 + ... "total_messages": 2, + ... "voice_banned": False, + ... "activity_blocks": 1 ...} #### Status codes @@ -255,6 +257,7 @@ class UserViewSet(ModelViewSet): data = metricity.user(user.id) data["total_messages"] = metricity.total_messages(user.id) data["voice_banned"] = voice_banned + data["activity_blocks"] = metricity.total_message_blocks(user.id) return Response(data, status=status.HTTP_200_OK) except NotFound: return Response(dict(detail="User not found in metricity"), |