mirror of https://gitlab.com/litecord/litecord.git
schema: add CREATE_GROUP_DM_V9
This commit is contained in:
parent
4fc4f5a229
commit
3b17fd3d7d
|
|
@ -24,7 +24,7 @@ blueprint for direct messages
|
||||||
from quart import Blueprint, request, current_app as app, jsonify
|
from quart import Blueprint, request, current_app as app, jsonify
|
||||||
from logbook import Logger
|
from logbook import Logger
|
||||||
|
|
||||||
from ..schemas import validate, CREATE_DM, CREATE_GROUP_DM
|
from ..schemas import validate, CREATE_DM, CREATE_GROUP_DM, CREATE_GROUP_DM_V9
|
||||||
from ..enums import ChannelType
|
from ..enums import ChannelType
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -117,8 +117,13 @@ async def create_group_dm(p_user_id: int):
|
||||||
user_id = await token_check()
|
user_id = await token_check()
|
||||||
assert user_id == p_user_id
|
assert user_id == p_user_id
|
||||||
|
|
||||||
j = validate(await request.get_json(), CREATE_GROUP_DM)
|
j = validate(
|
||||||
recipients = j["recipients"]
|
await request.get_json(),
|
||||||
|
CREATE_GROUP_DM_V9 if request.discord_api_version == 9 else CREATE_GROUP_DM,
|
||||||
|
)
|
||||||
|
recipients = (
|
||||||
|
j["recipients"] if request.discord_api_version == 9 else j["recipient_id"]
|
||||||
|
)
|
||||||
|
|
||||||
if len(recipients) == 1:
|
if len(recipients) == 1:
|
||||||
# its a group dm with 1 user... a dm!
|
# its a group dm with 1 user... a dm!
|
||||||
|
|
|
||||||
|
|
@ -537,6 +537,10 @@ CREATE_GROUP_DM = {
|
||||||
"recipients": {"type": "list", "required": True, "schema": {"type": "snowflake"}}
|
"recipients": {"type": "list", "required": True, "schema": {"type": "snowflake"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CREATE_GROUP_DM_V9 = {
|
||||||
|
"recipient_id": {"type": "list", "required": True, "schema": {"type": "snowflake"}}
|
||||||
|
}
|
||||||
|
|
||||||
GROUP_DM_UPDATE = {
|
GROUP_DM_UPDATE = {
|
||||||
"name": {"type": "guild_name", "required": False},
|
"name": {"type": "guild_name", "required": False},
|
||||||
"icon": {"type": "b64_icon", "required": False, "nullable": True},
|
"icon": {"type": "b64_icon", "required": False, "nullable": True},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue