221 lines
6.2 KiB
JSON
221 lines
6.2 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"name": "INVITE_CREATE",
|
|
"description": "Sent when an invite to a channel or pack is created. The payload structure varies based on invite type.",
|
|
"scope": "guild",
|
|
"scopeNote": "Guild scope for guild invites (MANAGE_CHANNELS permission required), presence scope for group DM invites (sent to all recipients)",
|
|
"dispatchedBy": ["POST /channels/:channel_id/invites", "POST /packs/:pack_id/invites"],
|
|
"payload": {
|
|
"oneOf": [
|
|
{
|
|
"type": "object",
|
|
"description": "Guild invite metadata response",
|
|
"properties": {
|
|
"code": {
|
|
"type": "string",
|
|
"description": "The unique invite code"
|
|
},
|
|
"type": {
|
|
"type": "integer",
|
|
"const": 0,
|
|
"description": "Invite type (0 = guild)"
|
|
},
|
|
"guild": {
|
|
"$ref": "GuildPartialResponse",
|
|
"description": "The guild this invite is for"
|
|
},
|
|
"channel": {
|
|
"$ref": "ChannelPartialResponse",
|
|
"description": "The channel this invite is for"
|
|
},
|
|
"inviter": {
|
|
"$ref": "UserPartialResponse",
|
|
"description": "User who created the invite"
|
|
},
|
|
"member_count": {
|
|
"type": "integer",
|
|
"description": "Approximate total member count of the guild"
|
|
},
|
|
"presence_count": {
|
|
"type": "integer",
|
|
"description": "Approximate online member count of the guild"
|
|
},
|
|
"expires_at": {
|
|
"type": ["string", "null"],
|
|
"format": "date-time",
|
|
"description": "ISO8601 timestamp of when the invite expires"
|
|
},
|
|
"temporary": {
|
|
"type": "boolean",
|
|
"description": "Whether the invite grants temporary membership"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "ISO8601 timestamp of when the invite was created"
|
|
},
|
|
"uses": {
|
|
"type": "integer",
|
|
"description": "Number of times the invite has been used"
|
|
},
|
|
"max_uses": {
|
|
"type": "integer",
|
|
"description": "Maximum number of times the invite can be used"
|
|
},
|
|
"max_age": {
|
|
"type": "integer",
|
|
"description": "Duration in seconds before the invite expires"
|
|
}
|
|
},
|
|
"required": [
|
|
"code",
|
|
"type",
|
|
"guild",
|
|
"channel",
|
|
"member_count",
|
|
"presence_count",
|
|
"temporary",
|
|
"created_at",
|
|
"uses",
|
|
"max_uses",
|
|
"max_age"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"description": "Group DM invite metadata response",
|
|
"properties": {
|
|
"code": {
|
|
"type": "string",
|
|
"description": "The unique invite code"
|
|
},
|
|
"type": {
|
|
"type": "integer",
|
|
"const": 1,
|
|
"description": "Invite type (1 = group DM)"
|
|
},
|
|
"channel": {
|
|
"$ref": "ChannelPartialResponse",
|
|
"description": "The group DM channel this invite is for"
|
|
},
|
|
"inviter": {
|
|
"$ref": "UserPartialResponse",
|
|
"description": "User who created the invite"
|
|
},
|
|
"member_count": {
|
|
"type": "integer",
|
|
"description": "Current member count of the group DM"
|
|
},
|
|
"expires_at": {
|
|
"type": ["string", "null"],
|
|
"format": "date-time",
|
|
"description": "ISO8601 timestamp of when the invite expires"
|
|
},
|
|
"temporary": {
|
|
"type": "boolean",
|
|
"description": "Whether the invite grants temporary membership"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "ISO8601 timestamp of when the invite was created"
|
|
},
|
|
"uses": {
|
|
"type": "integer",
|
|
"description": "Number of times the invite has been used"
|
|
},
|
|
"max_uses": {
|
|
"type": "integer",
|
|
"description": "Maximum number of times the invite can be used"
|
|
}
|
|
},
|
|
"required": ["code", "type", "channel", "member_count", "temporary", "created_at", "uses", "max_uses"]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"description": "Pack invite metadata response (emoji or sticker pack)",
|
|
"properties": {
|
|
"code": {
|
|
"type": "string",
|
|
"description": "The unique invite code"
|
|
},
|
|
"type": {
|
|
"type": "integer",
|
|
"enum": [2, 3],
|
|
"description": "Invite type (2 = emoji pack, 3 = sticker pack)"
|
|
},
|
|
"pack": {
|
|
"type": "object",
|
|
"description": "The pack this invite is for",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "Pack ID"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "Pack name"
|
|
},
|
|
"description": {
|
|
"type": ["string", "null"],
|
|
"description": "Pack description"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["emoji", "sticker"],
|
|
"description": "Pack type"
|
|
},
|
|
"creator_id": {
|
|
"type": "string",
|
|
"description": "ID of the user who created the pack"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "ISO8601 timestamp of when the pack was created"
|
|
},
|
|
"updated_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "ISO8601 timestamp of when the pack was last updated"
|
|
},
|
|
"creator": {
|
|
"$ref": "UserPartialResponse",
|
|
"description": "The user who created the pack"
|
|
}
|
|
},
|
|
"required": ["id", "name", "type", "creator_id", "created_at", "updated_at", "creator"]
|
|
},
|
|
"inviter": {
|
|
"$ref": "UserPartialResponse",
|
|
"description": "User who created the invite"
|
|
},
|
|
"expires_at": {
|
|
"type": ["string", "null"],
|
|
"format": "date-time",
|
|
"description": "ISO8601 timestamp of when the invite expires"
|
|
},
|
|
"temporary": {
|
|
"type": "boolean",
|
|
"description": "Whether the invite grants temporary access"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "ISO8601 timestamp of when the invite was created"
|
|
},
|
|
"uses": {
|
|
"type": "integer",
|
|
"description": "Number of times the invite has been used"
|
|
},
|
|
"max_uses": {
|
|
"type": "integer",
|
|
"description": "Maximum number of times the invite can be used"
|
|
}
|
|
},
|
|
"required": ["code", "type", "pack", "temporary", "created_at", "uses", "max_uses"]
|
|
}
|
|
]
|
|
}
|
|
}
|