From 276fc4c0938f2422e5e8a4b4e447e61b07b07877 Mon Sep 17 00:00:00 2001 From: Luna Date: Fri, 15 Mar 2019 16:14:44 -0300 Subject: [PATCH] docs/admin_api.md: add Guilds and Guild features sections --- docs/admin_api.md | 27 +++++++++++++++++++++++ litecord/blueprints/admin_api/features.py | 4 ++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/docs/admin_api.md b/docs/admin_api.md index 7e0ea31..c2724a6 100644 --- a/docs/admin_api.md +++ b/docs/admin_api.md @@ -45,3 +45,30 @@ Mark a voice region as deprecated. Disables any voice actions on guilds that are using the voice region. Returns empty body with 204 status code on success. + +## Guilds + +### GET `/guilds/` + +Returns a partial guild object. + +## Guild features + +### PATCH `/guilds//features` + +Patch the entire features list. Returns the new feature list following the same +structure as the input. + +| field | type | description | +| --: | :-- | :-- | +| features | List[string] | new list of features | + +### PUT `/guilds//features` + +Insert features. Receives and returns the same structure as +PATCH `/guilds//features`. + +### DELETE `/guilds//features` + +Remove features. Receives and returns the same structure as +PATCH `/guilds//features`. diff --git a/litecord/blueprints/admin_api/features.py b/litecord/blueprints/admin_api/features.py index 81d5099..69b338f 100644 --- a/litecord/blueprints/admin_api/features.py +++ b/litecord/blueprints/admin_api/features.py @@ -94,8 +94,8 @@ async def insert_features(guild_id: int): return await _features(guild_id) -@bp.route('//', methods=['DELETE']) -async def remove_feature(guild_id: int): +@bp.route('//features', methods=['DELETE']) +async def remove_features(guild_id: int): """Remove a feature from a guild""" await admin_check() to_remove = await _features_from_req()