quickfixes

This commit is contained in:
Luna 2019-07-21 00:15:48 -03:00
parent 473e4ca310
commit c5020f202e
1 changed files with 6 additions and 3 deletions

View File

@ -614,7 +614,8 @@ async def _search_channel(channel_id):
return jsonify(await search_result_from_list(rows)) return jsonify(await search_result_from_list(rows))
@bp.route('/<int:channel_id>/messages/<int:message_id>/suppress-embeds') @bp.route('/<int:channel_id>/messages/<int:message_id>/suppress-embeds',
methods=['POST'])
async def suppress_embeds(channel_id: int, message_id: int): async def suppress_embeds(channel_id: int, message_id: int):
"""Toggle the embeds in a message. """Toggle the embeds in a message.
@ -641,8 +642,10 @@ async def suppress_embeds(channel_id: int, message_id: int):
if not can_suppress: if not can_suppress:
raise Forbidden('Not enough permissions.') raise Forbidden('Not enough permissions.')
j = validate({'suppress': {'type': 'boolean'}}, j = validate(
await request.get_json()) await request.get_json(),
{'suppress': {'type': 'boolean'}},
)
suppress = j['suppress'] suppress = j['suppress']
message = await app.storage.get_message(message_id) message = await app.storage.get_message(message_id)