docs/admin_api.md: add Guilds and Guild features sections

This commit is contained in:
Luna 2019-03-15 16:14:44 -03:00
parent 30be092c3c
commit 276fc4c093
2 changed files with 29 additions and 2 deletions

View File

@ -45,3 +45,30 @@ Mark a voice region as deprecated. Disables any voice actions on guilds that are
using the voice region. using the voice region.
Returns empty body with 204 status code on success. Returns empty body with 204 status code on success.
## Guilds
### GET `/guilds/<guild_id>`
Returns a partial guild object.
## Guild features
### PATCH `/guilds/<guild_id>/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/<guild_id>/features`
Insert features. Receives and returns the same structure as
PATCH `/guilds/<guild_id>/features`.
### DELETE `/guilds/<guild_id>/features`
Remove features. Receives and returns the same structure as
PATCH `/guilds/<guild_id>/features`.

View File

@ -94,8 +94,8 @@ async def insert_features(guild_id: int):
return await _features(guild_id) return await _features(guild_id)
@bp.route('/<int:guild_id>/<feature>', methods=['DELETE']) @bp.route('/<int:guild_id>/features', methods=['DELETE'])
async def remove_feature(guild_id: int): async def remove_features(guild_id: int):
"""Remove a feature from a guild""" """Remove a feature from a guild"""
await admin_check() await admin_check()
to_remove = await _features_from_req() to_remove = await _features_from_req()