From 99d9bf563fb5e157600824776b149ca03cbea47c Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Sun, 10 Dec 2023 17:02:27 -0500 Subject: [PATCH 1/8] Start implementing webhooks --- assets/schemas.json | 5065 +++++++++++++++-- src/api/middlewares/Authentication.ts | 4 +- .../routes/channels/#channel_id/webhooks.ts | 25 +- src/api/routes/guilds/#guild_id/webhooks.ts | 35 +- .../webhooks/#webhook_id/#token/index.ts | 215 + src/api/routes/webhooks/#webhook_id/index.ts | 32 + src/util/schemas/MessageCreateSchema.ts | 4 +- src/util/schemas/WebhookCreateSchema.ts | 1 - src/util/schemas/WebhookExecuteSchema.ts | 46 + src/util/schemas/index.ts | 1 + src/util/util/Constants.ts | 2 +- 11 files changed, 5029 insertions(+), 401 deletions(-) create mode 100644 src/api/routes/webhooks/#webhook_id/#token/index.ts create mode 100644 src/api/routes/webhooks/#webhook_id/index.ts create mode 100644 src/util/schemas/WebhookExecuteSchema.ts diff --git a/assets/schemas.json b/assets/schemas.json index a0ab1697..018ddaca 100644 --- a/assets/schemas.json +++ b/assets/schemas.json @@ -2285,7 +2285,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -3047,7 +3047,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -3562,7 +3562,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -6504,7 +6504,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -7266,7 +7266,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -7781,7 +7781,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -10723,7 +10723,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -11485,7 +11485,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -12000,7 +12000,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -14937,7 +14937,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -15699,7 +15699,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -16214,7 +16214,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -19187,7 +19187,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -19949,7 +19949,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -20464,7 +20464,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -23406,7 +23406,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -24168,7 +24168,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -24683,7 +24683,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -27616,7 +27616,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -28378,7 +28378,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -28893,7 +28893,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -31829,7 +31829,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -32591,7 +32591,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -33106,7 +33106,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -36051,7 +36051,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -36813,7 +36813,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -37328,7 +37328,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -40261,7 +40261,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -41023,7 +41023,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -41538,7 +41538,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -44471,7 +44471,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -45233,7 +45233,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -45748,7 +45748,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -48700,7 +48700,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -49462,7 +49462,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -49977,7 +49977,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -52913,7 +52913,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -53675,7 +53675,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -54190,7 +54190,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -57186,7 +57186,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -57948,7 +57948,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -58463,7 +58463,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -61418,7 +61418,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -62180,7 +62180,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -62695,7 +62695,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -65791,7 +65791,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -66553,7 +66553,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -67068,7 +67068,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -70022,7 +70022,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -70784,7 +70784,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -71299,7 +71299,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -74263,7 +74263,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -75025,7 +75025,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -75540,7 +75540,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -78486,7 +78486,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -79248,7 +79248,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -79763,7 +79763,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -82715,7 +82715,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -83477,7 +83477,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -83992,7 +83992,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -86934,7 +86934,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -87696,7 +87696,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -88211,7 +88211,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -91141,7 +91141,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -91903,7 +91903,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -92418,7 +92418,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -95466,7 +95466,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -96228,7 +96228,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -96743,7 +96743,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -99788,7 +99788,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -100550,7 +100550,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -101065,7 +101065,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -103998,7 +103998,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -104760,7 +104760,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -105275,7 +105275,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -108216,7 +108216,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -108978,7 +108978,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -109493,7 +109493,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -112427,7 +112427,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -113189,7 +113189,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -113704,7 +113704,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -116638,7 +116638,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -117400,7 +117400,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -117915,7 +117915,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -120884,7 +120884,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -121646,7 +121646,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -122161,7 +122161,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -125095,7 +125095,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -125857,7 +125857,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -126372,7 +126372,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -129305,7 +129305,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -130067,7 +130067,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -130582,7 +130582,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -133530,7 +133530,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -134292,7 +134292,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -134807,7 +134807,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -137744,7 +137744,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -138506,7 +138506,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -139021,7 +139021,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -142032,7 +142032,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -142794,7 +142794,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -143309,7 +143309,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -146242,7 +146242,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -147004,7 +147004,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -147519,7 +147519,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -150452,7 +150452,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -151214,7 +151214,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -151729,7 +151729,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -154659,7 +154659,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -155421,7 +155421,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -155936,7 +155936,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -158872,7 +158872,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -159634,7 +159634,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -160149,7 +160149,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -163095,7 +163095,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -163857,7 +163857,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -164372,7 +164372,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -167302,7 +167302,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -168064,7 +168064,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -168579,7 +168579,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -171558,7 +171558,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -172320,7 +172320,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -172835,7 +172835,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -175800,7 +175800,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -176562,7 +176562,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -177077,7 +177077,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -180007,7 +180007,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -180769,7 +180769,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -181284,7 +181284,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -184239,7 +184239,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -185001,7 +185001,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -185516,7 +185516,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -188560,7 +188560,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -189322,7 +189322,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -189837,7 +189837,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -192766,7 +192766,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -193528,7 +193528,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -194043,7 +194043,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -197011,7 +197011,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -197773,7 +197773,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -198288,7 +198288,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -201244,7 +201244,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -202006,7 +202006,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -202521,7 +202521,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -205529,7 +205529,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -206291,7 +206291,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -206806,7 +206806,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -209736,7 +209736,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -210498,7 +210498,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -211013,7 +211013,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -213951,7 +213951,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -214713,7 +214713,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -215228,7 +215228,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -218156,7 +218156,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -218918,7 +218918,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -219433,7 +219433,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -222367,7 +222367,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -223129,7 +223129,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -223644,7 +223644,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -226578,7 +226578,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -227340,7 +227340,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -227855,7 +227855,4304 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" + } + }, + "embeds": { + "type": "array", + "items": { + "$ref": "#/definitions/Embed" + } + }, + "mentions": { + "type": "array", + "items": { + "$ref": "#/definitions/PublicUser" + } + }, + "mention_roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "pinned": { + "type": "boolean" + }, + "mention_everyone": { + "type": "boolean" + }, + "tts": { + "type": "boolean" + }, + "timestamp": { + "type": "string" + }, + "edited_timestamp": { + "type": [ + "null", + "string" + ] + }, + "flags": { + "type": "integer" + }, + "components": { + "type": "array", + "items": {} + }, + "hit": { + "type": "boolean", + "enum": [ + true + ] + } + }, + "additionalProperties": false, + "required": [ + "attachments", + "author", + "channel_id", + "components", + "edited_timestamp", + "embeds", + "flags", + "hit", + "id", + "mention_roles", + "mentions", + "pinned", + "timestamp", + "tts", + "type" + ] + }, + "PublicUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "avatar": { + "type": "string" + }, + "username": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" + }, + "accent_color": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "bot": { + "type": "boolean" + }, + "premium_type": { + "type": "integer" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "bio", + "bot", + "discriminator", + "id", + "premium_since", + "premium_type", + "public_flags", + "username" + ] + }, + "GuildVanityUrl": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "uses": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "code", + "uses" + ] + }, + "GuildVanityUrlNoInvite": { + "type": "object", + "properties": { + "code": { + "type": "null" + } + }, + "additionalProperties": false, + "required": [ + "code" + ] + }, + "ClientStatus": { + "type": "object", + "properties": { + "desktop": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "web": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Snowflake": { + "description": "A container for useful snowflake-related methods.", + "type": "object", + "additionalProperties": false + }, + "TenorGifResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + }, + "src": { + "type": "string" + }, + "gif_src": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "preview": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "gif_src", + "height", + "id", + "preview", + "src", + "title", + "url", + "width" + ] + }, + "BackupCode": { + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/User" + }, + "code": { + "type": "string" + }, + "consumed": { + "type": "boolean" + }, + "expired": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "consumed", + "expired", + "id", + "user" + ] + }, + "APIGuild": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "reload": { + "description": "Reloads entity data from the database.", + "type": "object", + "additionalProperties": false + }, + "id": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "parent": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "nsfw": { + "type": "boolean" + }, + "invites": { + "type": "array", + "items": { + "$ref": "#/definitions/Invite" + } + }, + "voice_states": { + "type": "array", + "items": { + "$ref": "#/definitions/VoiceState" + } + }, + "webhooks": { + "type": "array", + "items": { + "$ref": "#/definitions/Webhook" + } + }, + "toJSON": { + "type": "object", + "additionalProperties": false + }, + "_do_validate": { + "type": "object", + "additionalProperties": false + }, + "assign": { + "type": "object", + "additionalProperties": false + }, + "hasId": { + "description": "Checks if entity has an id.\nIf entity composite compose ids, it will check them all.", + "type": "object", + "additionalProperties": false + }, + "save": { + "description": "Saves current entity in the database.\nIf entity does not exist in the database then inserts, otherwise updates.", + "type": "object", + "additionalProperties": false + }, + "remove": { + "description": "Removes current entity from the database.", + "type": "object", + "additionalProperties": false + }, + "softRemove": { + "description": "Records the delete date of current entity.", + "type": "object", + "additionalProperties": false + }, + "recover": { + "description": "Recovers a given entity in the database.", + "type": "object", + "additionalProperties": false + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "banner": { + "type": "string" + }, + "description": { + "type": "string" + }, + "unavailable": { + "type": "boolean" + }, + "channels": { + "type": "array", + "items": { + "$ref": "#/definitions/Channel" + } + }, + "region": { + "type": "string" + }, + "system_channel_id": { + "type": "string" + }, + "rules_channel_id": { + "type": "string" + }, + "afk_timeout": { + "type": "integer" + }, + "explicit_content_filter": { + "type": "integer" + }, + "afk_channel_id": { + "type": "string" + }, + "bans": { + "type": "array", + "items": { + "$ref": "#/definitions/Ban" + } + }, + "default_message_notifications": { + "type": "integer" + }, + "discovery_splash": { + "type": "string" + }, + "features": { + "type": "array", + "items": { + "type": "string" + } + }, + "primary_category_id": { + "type": "string" + }, + "large": { + "type": "boolean" + }, + "max_members": { + "type": "integer" + }, + "max_presences": { + "type": "integer" + }, + "max_video_channel_users": { + "type": "integer" + }, + "member_count": { + "type": "integer" + }, + "presence_count": { + "type": "integer" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + }, + "template_id": { + "type": "string" + }, + "emojis": { + "type": "array", + "items": { + "$ref": "#/definitions/Emoji" + } + }, + "stickers": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "mfa_level": { + "type": "integer" + }, + "preferred_locale": { + "type": "string" + }, + "premium_subscription_count": { + "type": "integer" + }, + "premium_tier": { + "type": "integer" + }, + "public_updates_channel_id": { + "type": "string" + }, + "splash": { + "type": "string" + }, + "system_channel_flags": { + "type": "integer" + }, + "verification_level": { + "type": "integer" + }, + "welcome_screen": { + "$ref": "#/definitions/GuildWelcomeScreen" + }, + "widget_channel_id": { + "type": "string" + }, + "widget_enabled": { + "type": "boolean" + }, + "nsfw_level": { + "type": "integer" + }, + "permissions": { + "type": "integer" + }, + "premium_progress_bar_enabled": { + "type": "boolean" + }, + "channel_ordering": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "_do_validate", + "assign", + "bans", + "channel_ordering", + "channels", + "emojis", + "features", + "hasId", + "id", + "invites", + "members", + "name", + "nsfw", + "premium_progress_bar_enabled", + "public_updates_channel_id", + "recover", + "reload", + "remove", + "roles", + "save", + "softRemove", + "stickers", + "toJSON", + "unavailable", + "voice_states", + "webhooks", + "welcome_screen", + "widget_enabled" + ] + }, + "DmChannelDTO": { + "type": "object", + "properties": { + "icon": { + "type": [ + "null", + "string" + ] + }, + "id": { + "type": "string" + }, + "last_message_id": { + "type": [ + "null", + "string" + ] + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "origin_channel_id": { + "type": [ + "null", + "string" + ] + }, + "owner_id": { + "type": "string" + }, + "recipients": { + "type": "array", + "items": { + "$ref": "#/definitions/MinimalPublicUserDTO" + } + }, + "type": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "icon", + "id", + "last_message_id", + "name", + "origin_channel_id", + "recipients", + "type" + ] + }, + "MinimalPublicUserDTO": { + "type": "object", + "properties": { + "avatar": { + "type": [ + "null", + "string" + ] + }, + "discriminator": { + "type": "string" + }, + "id": { + "type": "string" + }, + "public_flags": { + "type": "integer" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "discriminator", + "id", + "public_flags", + "username" + ] + }, + "Categories": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "localizations": { + "type": "string" + }, + "is_primary": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id", + "is_primary", + "localizations", + "name" + ] + }, + "GuildVoiceRegion": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "custom": { + "type": "boolean" + }, + "deprecated": { + "type": "boolean" + }, + "optimal": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "custom", + "deprecated", + "id", + "name", + "optimal" + ] + }, + "UserLimits": { + "type": "object", + "properties": { + "maxGuilds": { + "type": "integer", + "default": 1048576 + }, + "maxUsername": { + "type": "integer", + "default": 32 + }, + "maxFriends": { + "type": "integer", + "default": 5000 + } + }, + "additionalProperties": false, + "required": [ + "maxFriends", + "maxGuilds", + "maxUsername" + ] + }, + "GuildLimits": { + "type": "object", + "properties": { + "maxRoles": { + "type": "integer", + "default": 1000 + }, + "maxEmojis": { + "type": "integer", + "default": 2000 + }, + "maxMembers": { + "type": "integer", + "default": 25000000 + }, + "maxChannels": { + "type": "integer", + "default": 65535 + }, + "maxChannelsInCategory": { + "type": "integer", + "default": 65535 + } + }, + "additionalProperties": false, + "required": [ + "maxChannels", + "maxChannelsInCategory", + "maxEmojis", + "maxMembers", + "maxRoles" + ] + }, + "MessageLimits": { + "type": "object", + "properties": { + "maxCharacters": { + "type": "integer", + "default": 1048576 + }, + "maxTTSCharacters": { + "type": "integer", + "default": 160 + }, + "maxReactions": { + "type": "integer", + "default": 2048 + }, + "maxAttachmentSize": { + "type": "integer", + "default": 1073741824 + }, + "maxBulkDelete": { + "type": "integer", + "default": 1000 + }, + "maxEmbedDownloadSize": { + "type": "integer", + "default": 5242880 + } + }, + "additionalProperties": false, + "required": [ + "maxAttachmentSize", + "maxBulkDelete", + "maxCharacters", + "maxEmbedDownloadSize", + "maxReactions", + "maxTTSCharacters" + ] + }, + "ChannelLimits": { + "type": "object", + "properties": { + "maxPins": { + "type": "integer", + "default": 500 + }, + "maxTopic": { + "type": "integer", + "default": 1024 + }, + "maxWebhooks": { + "type": "integer", + "default": 100 + } + }, + "additionalProperties": false, + "required": [ + "maxPins", + "maxTopic", + "maxWebhooks" + ] + }, + "RateLimits": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": false + }, + "ip": { + "$ref": "#/definitions/RateLimitOptions" + }, + "global": { + "$ref": "#/definitions/RateLimitOptions" + }, + "error": { + "$ref": "#/definitions/RateLimitOptions" + }, + "routes": { + "$ref": "#/definitions/RouteRateLimit" + } + }, + "additionalProperties": false, + "required": [ + "enabled", + "error", + "global", + "ip", + "routes" + ] + }, + "RateLimitOptions": { + "type": "object", + "properties": { + "bot": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "window": { + "type": "integer" + }, + "onyIp": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "count", + "window" + ] + }, + "RouteRateLimit": { + "type": "object", + "properties": { + "guild": { + "$ref": "#/definitions/RateLimitOptions" + }, + "webhook": { + "$ref": "#/definitions/RateLimitOptions" + }, + "channel": { + "$ref": "#/definitions/RateLimitOptions" + }, + "auth": {} + }, + "additionalProperties": false, + "required": [ + "auth", + "channel", + "guild", + "webhook" + ] + }, + "GlobalRateLimits": { + "type": "object", + "properties": { + "register": { + "$ref": "#/definitions/GlobalRateLimit" + }, + "sendMessage": { + "$ref": "#/definitions/GlobalRateLimit" + } + }, + "additionalProperties": false, + "required": [ + "register", + "sendMessage" + ] + }, + "GlobalRateLimit": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "default": 100 + }, + "window": { + "type": "integer", + "default": 3600000 + }, + "enabled": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false, + "required": [ + "enabled", + "limit", + "window" + ] + }, + "PublicConnectedAccount": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "verified": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type" + ] + }, + "UserProfile": { + "type": "object", + "properties": { + "accent_color": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "bio" + ] + }, + "TokenResponse": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "settings": { + "$ref": "#/definitions/UserSettings" + } + }, + "additionalProperties": false, + "required": [ + "settings", + "token" + ] + }, + "MFAResponse": { + "type": "object", + "properties": { + "ticket": { + "type": "string" + }, + "mfa": { + "type": "boolean", + "enum": [ + true + ] + }, + "sms": { + "type": "boolean", + "enum": [ + false + ] + }, + "token": { + "type": "null" + } + }, + "additionalProperties": false, + "required": [ + "mfa", + "sms", + "ticket", + "token" + ] + }, + "WebAuthnResponse": { + "type": "object", + "properties": { + "webauthn": { + "type": "string" + }, + "ticket": { + "type": "string" + }, + "mfa": { + "type": "boolean", + "enum": [ + true + ] + }, + "sms": { + "type": "boolean", + "enum": [ + false + ] + }, + "token": { + "type": "null" + } + }, + "additionalProperties": false, + "required": [ + "mfa", + "sms", + "ticket", + "token", + "webauthn" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "WebhookExecuteSchema": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "username": { + "type": "string" + }, + "avatar_url": { + "type": "string" + }, + "tts": { + "type": "boolean" + }, + "embeds": { + "type": "array", + "items": { + "$ref": "#/definitions/Embed" + } + }, + "allowed_mentions": { + "type": "object", + "properties": { + "parse": { + "type": "array", + "items": { + "type": "string" + } + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "components": { + "type": "array", + "items": {} + }, + "file": { + "type": "object", + "properties": { + "filename": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filename" + ] + }, + "payload_json": { + "type": "string" + }, + "attachments": { + "description": "TODO: we should create an interface for attachments\nTODO: OpenWAAO<-->attachment-style metadata conversion", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filename", + "id" + ] + } + }, + "flags": { + "type": "integer" + }, + "thread_name": { + "type": "string" + }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "definitions": { + "ChannelPermissionOverwriteType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "ConnectedAccountTokenData": { + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "token_type": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "refresh_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "expires_at": { + "type": "integer" + }, + "fetched_at": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "access_token", + "fetched_at" + ] + }, + "ChannelModifySchema": { + "type": "object", + "properties": { + "name": { + "maxLength": 100, + "type": "string" + }, + "type": { + "enum": [ + 0, + 1, + 10, + 11, + 12, + 13, + 14, + 15, + 2, + 255, + 3, + 33, + 34, + 35, + 4, + 5, + 6, + 64, + 7, + 8, + 9 + ], + "type": "number" + }, + "topic": { + "type": "string" + }, + "icon": { + "type": [ + "null", + "string" + ] + }, + "bitrate": { + "type": "integer" + }, + "user_limit": { + "type": "integer" + }, + "rate_limit_per_user": { + "type": "integer" + }, + "position": { + "type": "integer" + }, + "permission_overwrites": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/ChannelPermissionOverwriteType" + }, + "allow": { + "type": "string" + }, + "deny": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "allow", + "deny", + "id", + "type" + ] + } + }, + "parent_id": { + "type": "string" + }, + "id": { + "type": "string" + }, + "nsfw": { + "type": "boolean" + }, + "rtc_region": { + "type": "string" + }, + "default_auto_archive_duration": { + "type": "integer" + }, + "default_reaction_emoji": { + "type": [ + "null", + "string" + ] + }, + "flags": { + "type": "integer" + }, + "default_thread_rate_limit_per_user": { + "type": "integer" + }, + "video_quality_mode": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "ActivitySchema": { + "type": "object", + "properties": { + "afk": { + "type": "boolean" + }, + "status": { + "$ref": "#/definitions/Status" + }, + "activities": { + "type": "array", + "items": { + "$ref": "#/definitions/Activity" + } + }, + "since": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "status" + ] + }, + "Status": { + "enum": [ + "dnd", + "idle", + "invisible", + "offline", + "online" + ], + "type": "string" + }, + "Activity": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/ActivityType" + }, + "url": { + "type": "string" + }, + "created_at": { + "type": "integer" + }, + "timestamps": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "end": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end", + "start" + ] + }, + "application_id": { + "type": "string" + }, + "details": { + "type": "string" + }, + "state": { + "type": "string" + }, + "emoji": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "animated", + "name" + ] + }, + "party": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "size": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false + }, + "assets": { + "type": "object", + "properties": { + "large_image": { + "type": "string" + }, + "large_text": { + "type": "string" + }, + "small_image": { + "type": "string" + }, + "small_text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "secrets": { + "type": "object", + "properties": { + "join": { + "type": "string" + }, + "spectate": { + "type": "string" + }, + "match": { + "type": "string" + } + }, + "additionalProperties": false + }, + "instance": { + "type": "boolean" + }, + "flags": { + "type": "string" + }, + "id": { + "type": "string" + }, + "sync_id": { + "type": "string" + }, + "metadata": { + "type": "object", + "properties": { + "context_uri": { + "type": "string" + }, + "album_id": { + "type": "string" + }, + "artist_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "album_id", + "artist_ids" + ] + }, + "session_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "flags", + "name", + "session_id", + "type" + ] + }, + "ActivityType": { + "enum": [ + 0, + 1, + 2, + 4, + 5 + ], + "type": "number" + }, + "Embed": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "type": { + "enum": [ + "article", + "gifv", + "image", + "link", + "rich", + "video" + ], + "type": "string" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "color": { + "type": "integer" + }, + "footer": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "icon_url": { + "type": "string" + }, + "proxy_icon_url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "text" + ] + }, + "image": { + "$ref": "#/definitions/EmbedImage" + }, + "thumbnail": { + "$ref": "#/definitions/EmbedImage" + }, + "video": { + "$ref": "#/definitions/EmbedImage" + }, + "provider": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false + }, + "author": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string" + }, + "icon_url": { + "type": "string" + }, + "proxy_icon_url": { + "type": "string" + } + }, + "additionalProperties": false + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "inline": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name", + "value" + ] + } + } + }, + "additionalProperties": false + }, + "EmbedImage": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "proxy_url": { + "type": "string" + }, + "height": { + "type": "integer" + }, + "width": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "ChannelOverride": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false, + "required": [ + "channel_id", + "message_notifications", + "mute_config", + "muted" + ] + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] + }, + "CustomStatus": { + "type": "object", + "properties": { + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "expires_at": { + "type": "integer" + }, + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "FriendSourceFlags": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "all" + ] + }, + "GuildFolder": { + "type": "object", + "properties": { + "color": { + "type": "integer" + }, + "guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "color", + "guild_ids", + "id", + "name" + ] + }, + "GenerateWebAuthnCredentialsSchema": { + "type": "object", + "properties": { + "password": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "password" + ] + }, + "CreateWebAuthnCredentialSchema": { + "type": "object", + "properties": { + "credential": { + "type": "string" + }, + "name": { + "type": "string" + }, + "ticket": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "credential", + "name", + "ticket" + ] + }, + "APIErrorResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "errors": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "_errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "message" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "_errors" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "code", + "errors", + "message" + ] + }, + "CaptchaRequiredResponse": { + "type": "object", + "properties": { + "captcha_key": { + "type": "string" + }, + "captcha_sitekey": { + "type": "string" + }, + "captcha_service": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "captcha_key", + "captcha_service", + "captcha_sitekey" + ] + }, + "Guild": { + "type": "object", + "properties": { + "afk_channel_id": { + "type": "string" + }, + "afk_channel": { + "$ref": "#/definitions/Channel" + }, + "afk_timeout": { + "type": "integer" + }, + "bans": { + "type": "array", + "items": { + "$ref": "#/definitions/Ban" + } + }, + "banner": { + "type": "string" + }, + "default_message_notifications": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "discovery_splash": { + "type": "string" + }, + "explicit_content_filter": { + "type": "integer" + }, + "features": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "primary_category_id": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "large": { + "type": "boolean", + "default": false + }, + "max_members": { + "type": "integer" + }, + "max_presences": { + "type": "integer" + }, + "max_video_channel_users": { + "type": "integer" + }, + "member_count": { + "type": "integer" + }, + "presence_count": { + "type": "integer" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "channels": { + "type": "array", + "items": { + "$ref": "#/definitions/Channel" + } + }, + "template_id": { + "type": "string" + }, + "template": { + "$ref": "#/definitions/Template" + }, + "emojis": { + "type": "array", + "items": { + "$ref": "#/definitions/Emoji" + } + }, + "stickers": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "invites": { + "type": "array", + "items": { + "$ref": "#/definitions/Invite" + } + }, + "voice_states": { + "type": "array", + "items": { + "$ref": "#/definitions/VoiceState" + } + }, + "webhooks": { + "type": "array", + "items": { + "$ref": "#/definitions/Webhook" + } + }, + "mfa_level": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/User" + }, + "preferred_locale": { + "type": "string" + }, + "premium_subscription_count": { + "type": "integer" + }, + "premium_tier": { + "type": "integer" + }, + "public_updates_channel_id": { + "type": "string" + }, + "public_updates_channel": { + "$ref": "#/definitions/Channel" + }, + "rules_channel_id": { + "type": "string" + }, + "rules_channel": { + "type": "string" + }, + "region": { + "type": "string" + }, + "splash": { + "type": "string" + }, + "system_channel_id": { + "type": "string" + }, + "system_channel": { + "$ref": "#/definitions/Channel" + }, + "system_channel_flags": { + "type": "integer" + }, + "unavailable": { + "type": "boolean", + "default": false + }, + "verification_level": { + "type": "integer" + }, + "welcome_screen": { + "$ref": "#/definitions/GuildWelcomeScreen" + }, + "widget_channel_id": { + "type": "string" + }, + "widget_channel": { + "$ref": "#/definitions/Channel" + }, + "widget_enabled": { + "type": "boolean", + "default": true + }, + "nsfw_level": { + "type": "integer" + }, + "nsfw": { + "type": "boolean", + "default": false + }, + "parent": { + "type": "string" + }, + "permissions": { + "type": "integer" + }, + "premium_progress_bar_enabled": { + "type": "boolean", + "default": false + }, + "channel_ordering": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "bans", + "channel_ordering", + "channels", + "emojis", + "features", + "id", + "invites", + "members", + "name", + "nsfw", + "premium_progress_bar_enabled", + "public_updates_channel_id", + "roles", + "stickers", + "template", + "unavailable", + "voice_states", + "webhooks", + "welcome_screen", + "widget_enabled" + ] + }, + "Channel": { + "type": "object", + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "name": { + "type": "string" + }, + "icon": { + "type": [ + "null", + "string" + ] + }, + "type": { + "$ref": "#/definitions/ChannelType" + }, + "recipients": { + "type": "array", + "items": { + "$ref": "#/definitions/Recipient" + } + }, + "last_message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "parent_id": { + "type": "string" + }, + "parent": { + "$ref": "#/definitions/Channel" + }, + "owner_id": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/User" + }, + "last_pin_timestamp": { + "type": "integer" + }, + "default_auto_archive_duration": { + "type": "integer" + }, + "permission_overwrites": { + "type": "array", + "items": { + "$ref": "#/definitions/ChannelPermissionOverwrite" + } + }, + "video_quality_mode": { + "type": "integer" + }, + "bitrate": { + "type": "integer" + }, + "user_limit": { + "type": "integer" + }, + "nsfw": { + "type": "boolean", + "default": false + }, + "rate_limit_per_user": { + "type": "integer" + }, + "topic": { + "type": "string" + }, + "invites": { + "type": "array", + "items": { + "$ref": "#/definitions/Invite" + } + }, + "retention_policy_id": { + "type": "string" + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/definitions/Message" + } + }, + "voice_states": { + "type": "array", + "items": { + "$ref": "#/definitions/VoiceState" + } + }, + "read_states": { + "type": "array", + "items": { + "$ref": "#/definitions/ReadState" + } + }, + "webhooks": { + "type": "array", + "items": { + "$ref": "#/definitions/Webhook" + } + }, + "flags": { + "type": "integer", + "default": 0 + }, + "default_thread_rate_limit_per_user": { + "type": "integer", + "default": 0 + }, + "position": { + "description": "Must be calculated Channel.calculatePosition", + "type": "integer" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "created_at", + "default_thread_rate_limit_per_user", + "flags", + "id", + "nsfw", + "owner", + "parent_id", + "position", + "type" + ] + }, + "ChannelType": { + "enum": [ + 0, + 1, + 10, + 11, + 12, + 13, + 14, + 15, + 2, + 255, + 3, + 33, + 34, + 35, + 4, + 5, + 6, + 64, + 7, + 8, + 9 + ], + "type": "number" + }, + "Recipient": { + "type": "object", + "properties": { + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "closed": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "channel_id", + "closed", + "id", + "user", + "user_id" + ] + }, + "User": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "accent_color": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "desktop": { + "type": "boolean", + "default": false + }, + "mobile": { + "type": "boolean", + "default": false + }, + "premium": { + "type": "boolean" + }, + "premium_type": { + "type": "integer" + }, + "bot": { + "type": "boolean", + "default": false + }, + "bio": { + "type": "string", + "default": "" + }, + "system": { + "type": "boolean", + "default": false + }, + "nsfw_allowed": { + "type": "boolean", + "default": true + }, + "mfa_enabled": { + "type": "boolean", + "default": false + }, + "webauthn_enabled": { + "type": "boolean", + "default": false + }, + "totp_secret": { + "type": "string", + "default": "" + }, + "totp_last_ticket": { + "type": "string", + "default": "" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "verified": { + "type": "boolean" + }, + "disabled": { + "type": "boolean", + "default": false + }, + "deleted": { + "type": "boolean", + "default": false + }, + "email": { + "type": "string" + }, + "flags": { + "type": "integer", + "default": 0 + }, + "public_flags": { + "type": "integer", + "default": 0 + }, + "purchased_flags": { + "type": "integer", + "default": 0 + }, + "premium_usage_flags": { + "type": "integer", + "default": 0 + }, + "rights": { + "type": "string" + }, + "sessions": { + "type": "array", + "items": { + "$ref": "#/definitions/Session" + } + }, + "relationships": { + "type": "array", + "items": { + "$ref": "#/definitions/Relationship" + } + }, + "connected_accounts": { + "type": "array", + "items": { + "$ref": "#/definitions/ConnectedAccount" + } + }, + "data": { + "type": "object", + "properties": { + "valid_tokens_since": { + "type": "string", + "format": "date-time" + }, + "hash": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "valid_tokens_since" + ] + }, + "fingerprints": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "settings": { + "$ref": "#/definitions/UserSettings" + }, + "extended_settings": { + "type": "string", + "default": "{}" + }, + "security_keys": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityKey" + } + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "bio", + "bot", + "connected_accounts", + "created_at", + "data", + "deleted", + "desktop", + "disabled", + "discriminator", + "extended_settings", + "fingerprints", + "flags", + "id", + "mfa_enabled", + "mobile", + "nsfw_allowed", + "premium", + "premium_since", + "premium_type", + "premium_usage_flags", + "public_flags", + "purchased_flags", + "relationships", + "rights", + "security_keys", + "sessions", + "settings", + "system", + "username", + "verified", + "webauthn_enabled" + ] + }, + "Session": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "session_id": { + "type": "string" + }, + "activities": { + "type": "array", + "items": { + "$ref": "#/definitions/Activity" + } + }, + "client_info": { + "type": "object", + "properties": { + "client": { + "type": "string" + }, + "os": { + "type": "string" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "client", + "os", + "version" + ] + }, + "status": { + "$ref": "#/definitions/Status" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "activities", + "client_info", + "id", + "session_id", + "status", + "user", + "user_id" + ] + }, + "Relationship": { + "type": "object", + "properties": { + "from_id": { + "type": "string" + }, + "from": { + "$ref": "#/definitions/User" + }, + "to_id": { + "type": "string" + }, + "to": { + "$ref": "#/definitions/User" + }, + "nickname": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/RelationshipType" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "from", + "from_id", + "id", + "to", + "to_id", + "type" + ] + }, + "RelationshipType": { + "enum": [ + 1, + 2, + 3, + 4 + ], + "type": "number" + }, + "ConnectedAccount": { + "type": "object", + "properties": { + "external_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "friend_sync": { + "type": "boolean", + "default": false + }, + "name": { + "type": "string" + }, + "revoked": { + "type": "boolean", + "default": false + }, + "show_activity": { + "type": "integer", + "default": 0 + }, + "type": { + "type": "string" + }, + "verified": { + "type": "boolean", + "default": true + }, + "visibility": { + "type": "integer", + "default": 0 + }, + "integrations": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "metadata_": {}, + "metadata_visibility": { + "type": "integer", + "default": 0 + }, + "two_way_link": { + "type": "boolean", + "default": false + }, + "token_data": { + "anyOf": [ + { + "$ref": "#/definitions/ConnectedAccountTokenData" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "external_id", + "id", + "name", + "type", + "user", + "user_id" + ] + }, + "UserSettings": { + "type": "object", + "properties": { + "index": { + "type": "string" + }, + "afk_timeout": { + "type": "integer", + "default": 3600 + }, + "allow_accessibility_detection": { + "type": "boolean", + "default": true + }, + "animate_emoji": { + "type": "boolean", + "default": true + }, + "animate_stickers": { + "type": "integer", + "default": 0 + }, + "contact_sync_enabled": { + "type": "boolean", + "default": false + }, + "convert_emoticons": { + "type": "boolean", + "default": false + }, + "custom_status": { + "anyOf": [ + { + "$ref": "#/definitions/CustomStatus" + }, + { + "type": "null" + } + ], + "default": null + }, + "default_guilds_restricted": { + "type": "boolean", + "default": false + }, + "detect_platform_accounts": { + "type": "boolean", + "default": false + }, + "developer_mode": { + "type": "boolean", + "default": true + }, + "disable_games_tab": { + "type": "boolean", + "default": true + }, + "enable_tts_command": { + "type": "boolean", + "default": false + }, + "explicit_content_filter": { + "type": "integer", + "default": 0 + }, + "friend_source_flags": { + "$ref": "#/definitions/FriendSourceFlags" + }, + "gateway_connected": { + "type": "boolean", + "default": false + }, + "gif_auto_play": { + "type": "boolean", + "default": false + }, + "guild_folders": { + "type": "array", + "items": { + "$ref": "#/definitions/GuildFolder" + }, + "default": [] + }, + "guild_positions": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "inline_attachment_media": { + "type": "boolean", + "default": true + }, + "inline_embed_media": { + "type": "boolean", + "default": true + }, + "locale": { + "type": "string", + "default": "en-US" + }, + "message_display_compact": { + "type": "boolean", + "default": false + }, + "native_phone_integration_enabled": { + "type": "boolean", + "default": true + }, + "render_embeds": { + "type": "boolean", + "default": true + }, + "render_reactions": { + "type": "boolean", + "default": true + }, + "restricted_guilds": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "show_current_game": { + "type": "boolean", + "default": true + }, + "status": { + "enum": [ + "dnd", + "idle", + "invisible", + "offline", + "online" + ], + "type": "string", + "default": "online" + }, + "stream_notifications_enabled": { + "type": "boolean", + "default": false + }, + "theme": { + "enum": [ + "dark", + "light" + ], + "type": "string", + "default": "dark" + }, + "timezone_offset": { + "type": "integer", + "default": 0 + } + }, + "additionalProperties": false, + "required": [ + "afk_timeout", + "allow_accessibility_detection", + "animate_emoji", + "animate_stickers", + "contact_sync_enabled", + "convert_emoticons", + "custom_status", + "default_guilds_restricted", + "detect_platform_accounts", + "developer_mode", + "disable_games_tab", + "enable_tts_command", + "explicit_content_filter", + "friend_source_flags", + "gateway_connected", + "gif_auto_play", + "guild_folders", + "guild_positions", + "index", + "inline_attachment_media", + "inline_embed_media", + "locale", + "message_display_compact", + "native_phone_integration_enabled", + "render_embeds", + "render_reactions", + "restricted_guilds", + "show_current_game", + "status", + "stream_notifications_enabled", + "theme", + "timezone_offset" + ] + }, + "SecurityKey": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "key_id": { + "type": "string" + }, + "public_key": { + "type": "string" + }, + "counter": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "counter", + "id", + "key_id", + "name", + "public_key", + "user", + "user_id" + ] + }, + "ChannelPermissionOverwrite": { + "type": "object", + "properties": { + "allow": { + "type": "string" + }, + "deny": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/ChannelPermissionOverwriteType" + } + }, + "additionalProperties": false, + "required": [ + "allow", + "deny", + "id", + "type" + ] + }, + "Invite": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "temporary": { + "type": "boolean" + }, + "uses": { + "type": "integer" + }, + "max_uses": { + "type": "integer" + }, + "max_age": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "expires_at": { + "type": "string", + "format": "date-time" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "inviter_id": { + "type": "string" + }, + "inviter": { + "$ref": "#/definitions/User" + }, + "target_user_id": { + "type": "string" + }, + "target_user": { + "type": "string" + }, + "target_user_type": { + "type": "integer" + }, + "vanity_url": { + "type": "boolean" + }, + "flags": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "channel_id", + "code", + "created_at", + "flags", + "guild", + "guild_id", + "inviter", + "max_age", + "max_uses", + "target_user_id", + "temporary", + "uses" + ] + }, + "Message": { + "type": "object", + "properties": { + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "author_id": { + "type": "string" + }, + "author": { + "$ref": "#/definitions/User" + }, + "member_id": { + "type": "string" + }, + "member": { + "$ref": "#/definitions/Member" + }, + "webhook_id": { + "type": "string" + }, + "webhook": { + "$ref": "#/definitions/Webhook" + }, + "application_id": { + "type": "string" + }, + "application": { + "$ref": "#/definitions/Application" + }, + "content": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "edited_timestamp": { + "type": "string", + "format": "date-time" + }, + "tts": { + "type": "boolean" + }, + "mention_everyone": { + "type": "boolean" + }, + "mentions": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "mention_roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "mention_channels": { + "type": "array", + "items": { + "$ref": "#/definitions/Channel" + } + }, + "sticker_items": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/Attachment" + } + }, + "embeds": { + "type": "array", + "items": { + "$ref": "#/definitions/Embed" + } + }, + "reactions": { + "type": "array", + "items": { + "$ref": "#/definitions/Reaction" + } + }, + "nonce": { + "type": "string" + }, + "pinned": { + "type": "boolean" + }, + "type": { + "$ref": "#/definitions/MessageType" + }, + "activity": { + "type": "object", + "properties": { + "type": { + "type": "integer" + }, + "party_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "party_id", + "type" + ] + }, + "flags": { + "type": "integer" + }, + "message_reference": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message_id" + ] + }, + "referenced_message": { + "$ref": "#/definitions/Message" + }, + "interaction": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/InteractionType" + }, + "name": { + "type": "string" + }, + "user_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "name", + "type", + "user_id" + ] + }, + "components": { + "type": "array", + "items": { + "$ref": "#/definitions/MessageComponent" + } + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "embeds", + "id", + "mention_channels", + "mention_roles", + "mentions", + "reactions", + "timestamp", + "type" + ] + }, + "Member": { + "type": "object", + "properties": { + "index": { + "type": "string" + }, + "id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "nick": { + "type": "string" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "joined_at": { + "type": "string", + "format": "date-time" + }, + "premium_since": { + "type": "integer" + }, + "deaf": { + "type": "boolean" + }, + "mute": { + "type": "boolean" + }, + "pending": { + "type": "boolean" + }, + "settings": { + "$ref": "#/definitions/UserGuildSettings" + }, + "last_message_id": { + "type": "string" + }, + "joined_by": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "communication_disabled_until": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "required": [ + "banner", + "bio", + "communication_disabled_until", + "deaf", + "guild", + "guild_id", + "id", + "index", + "joined_at", + "joined_by", + "mute", + "pending", + "roles", + "settings", + "user" + ] + }, + "Role": { + "type": "object", + "properties": { + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "color": { + "type": "integer" + }, + "hoist": { + "type": "boolean" + }, + "managed": { + "type": "boolean" + }, + "mentionable": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "permissions": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "unicode_emoji": { + "type": "string" + }, + "tags": { + "type": "object", + "properties": { + "bot_id": { + "type": "string" + }, + "integration_id": { + "type": "string" + }, + "premium_subscriber": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "flags": { + "type": "integer" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "color", + "flags", + "guild", + "guild_id", + "hoist", + "id", + "managed", + "mentionable", + "name", + "permissions", + "position" + ] + }, + "UserGuildSettings": { + "type": "object", + "properties": { + "channel_overrides": { + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ChannelOverride" + } + }, + { + "type": "null" + } + ] + }, + "message_notifications": { + "type": "integer" + }, + "mobile_push": { + "type": "boolean" + }, + "mute_config": { + "anyOf": [ + { + "$ref": "#/definitions/MuteConfig" + }, + { + "type": "null" + } + ] + }, + "muted": { + "type": "boolean" + }, + "suppress_everyone": { + "type": "boolean" + }, + "suppress_roles": { + "type": "boolean" + }, + "version": { + "type": "integer" + }, + "guild_id": { + "type": [ + "null", + "string" + ] + }, + "flags": { + "type": "integer" + }, + "mute_scheduled_events": { + "type": "boolean" + }, + "hide_muted_channels": { + "type": "boolean" + }, + "notify_highlights": { + "type": "number", + "enum": [ + 0 + ] + } + }, + "additionalProperties": false, + "required": [ + "channel_overrides", + "flags", + "guild_id", + "hide_muted_channels", + "message_notifications", + "mobile_push", + "mute_config", + "mute_scheduled_events", + "muted", + "notify_highlights", + "suppress_everyone", + "suppress_roles", + "version" + ] + }, + "Webhook": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/WebhookType" + }, + "name": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "token": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "application_id": { + "type": "string" + }, + "application": { + "$ref": "#/definitions/Application" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "source_guild_id": { + "type": "string" + }, + "source_guild": { + "$ref": "#/definitions/Guild" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "application_id", + "channel", + "channel_id", + "guild", + "guild_id", + "id", + "source_guild", + "source_guild_id", + "type", + "user", + "user_id" + ] + }, + "WebhookType": { + "enum": [ + 1, + 2, + 3 + ], + "type": "number" + }, + "Application": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "description": { + "type": "string" + }, + "summary": { + "type": "string", + "default": "" + }, + "type": { + "type": "object", + "properties": {}, + "additionalProperties": true + }, + "hook": { + "type": "boolean", + "default": true + }, + "bot_public": { + "type": "boolean", + "default": true + }, + "bot_require_code_grant": { + "type": "boolean", + "default": false + }, + "verify_key": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/User" + }, + "flags": { + "type": "integer", + "default": 0 + }, + "redirect_uris": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "rpc_application_state": { + "type": "integer", + "default": 0 + }, + "store_application_state": { + "type": "integer", + "default": 1 + }, + "verification_state": { + "type": "integer", + "default": 1 + }, + "interactions_endpoint_url": { + "type": "string" + }, + "integration_public": { + "type": "boolean", + "default": true + }, + "integration_require_code_grant": { + "type": "boolean", + "default": false + }, + "discoverability_state": { + "type": "integer", + "default": 1 + }, + "discovery_eligibility_flags": { + "type": "integer", + "default": 2240 + }, + "bot": { + "$ref": "#/definitions/User" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "cover_image": { + "type": "string" + }, + "install_params": { + "type": "object", + "properties": { + "scopes": { + "type": "array", + "items": { + "type": "string" + } + }, + "permissions": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "permissions", + "scopes" + ] + }, + "terms_of_service_url": { + "type": "string" + }, + "privacy_policy_url": { + "type": "string" + }, + "team": { + "$ref": "#/definitions/Team" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "description", + "discoverability_state", + "discovery_eligibility_flags", + "flags", + "hook", + "id", + "integration_public", + "integration_require_code_grant", + "name", + "owner", + "redirect_uris", + "rpc_application_state", + "store_application_state", + "summary", + "verification_state", + "verify_key" + ] + }, + "Team": { + "type": "object", + "properties": { + "icon": { + "type": "string" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamMember" + } + }, + "name": { + "type": "string" + }, + "owner_user_id": { + "type": "string" + }, + "owner_user": { + "$ref": "#/definitions/User" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "members", + "name", + "owner_user", + "owner_user_id" + ] + }, + "TeamMember": { + "type": "object", + "properties": { + "membership_state": { + "$ref": "#/definitions/TeamMemberState" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "team_id": { + "type": "string" + }, + "team": { + "$ref": "#/definitions/Team" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "membership_state", + "permissions", + "team", + "team_id", + "user", + "user_id" + ] + }, + "TeamMemberState": { + "enum": [ + 1, + 2 + ], + "type": "number" + }, + "Sticker": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "available": { + "type": "boolean" + }, + "tags": { + "type": "string" + }, + "pack_id": { + "type": "string" + }, + "pack": { + "$ref": "#/definitions/StickerPack" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "type": { + "$ref": "#/definitions/StickerType" + }, + "format_type": { + "$ref": "#/definitions/StickerFormatType" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "format_type", + "id", + "name", + "pack", + "type" + ] + }, + "StickerPack": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "banner_asset_id": { + "type": "string" + }, + "stickers": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "cover_sticker_id": { + "type": "string" + }, + "cover_sticker": { + "$ref": "#/definitions/Sticker" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "name", + "stickers" + ] + }, + "StickerType": { + "enum": [ + 1, + 2 + ], + "type": "number" + }, + "StickerFormatType": { + "enum": [ + 0, + 1, + 2, + 3 + ], + "type": "number" + }, + "Attachment": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "proxy_url": { + "type": "string" + }, + "height": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "content_type": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "message": { + "$ref": "#/definitions/Message" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filename", + "id", + "message", + "message_id", + "proxy_url", + "size", + "url" + ] + }, + "Reaction": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "emoji": { + "$ref": "#/definitions/PartialEmoji" + }, + "user_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "count", + "emoji", + "user_ids" + ] + }, + "PartialEmoji": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + "MessageType": { + "enum": [ + 0, + 1, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 19, + 2, + 20, + 255, + 3, + 4, + 41, + 42, + 43, + 5, + 50, + 6, + 63, + 7, + 8, + 9 + ], + "type": "number" + }, + "InteractionType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "MessageComponent": { + "type": "object", + "properties": { + "type": { + "type": "integer" + }, + "style": { + "type": "integer" + }, + "label": { + "type": "string" + }, + "emoji": { + "$ref": "#/definitions/PartialEmoji" + }, + "custom_id": { + "type": "string" + }, + "url": { + "type": "string" + }, + "disabled": { + "type": "boolean" + }, + "components": { + "type": "array", + "items": { + "$ref": "#/definitions/MessageComponent" + } + } + }, + "additionalProperties": false, + "required": [ + "components", + "type" + ] + }, + "VoiceState": { + "type": "object", + "properties": { + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "member": { + "$ref": "#/definitions/Member" + }, + "session_id": { + "type": "string" + }, + "token": { + "type": "string" + }, + "deaf": { + "type": "boolean" + }, + "mute": { + "type": "boolean" + }, + "self_deaf": { + "type": "boolean" + }, + "self_mute": { + "type": "boolean" + }, + "self_stream": { + "type": "boolean" + }, + "self_video": { + "type": "boolean" + }, + "suppress": { + "type": "boolean" + }, + "request_to_speak_timestamp": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "channel_id", + "deaf", + "guild_id", + "id", + "member", + "mute", + "self_deaf", + "self_mute", + "self_video", + "session_id", + "suppress", + "token", + "user", + "user_id" + ] + }, + "ReadState": { + "type": "object", + "properties": { + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "last_message_id": { + "type": "string" + }, + "public_ack": { + "type": "string" + }, + "notifications_cursor": { + "type": "string" + }, + "last_pin_timestamp": { + "type": "string", + "format": "date-time" + }, + "mention_count": { + "type": "integer" + }, + "manual": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "channel_id", + "id", + "last_message_id", + "manual", + "mention_count", + "notifications_cursor", + "public_ack", + "user", + "user_id" + ] + }, + "Ban": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "executor_id": { + "type": "string" + }, + "executor": { + "$ref": "#/definitions/User" + }, + "ip": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "executor", + "executor_id", + "guild", + "guild_id", + "id", + "ip", + "user", + "user_id" + ] + }, + "Template": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "usage_count": { + "type": "integer" + }, + "creator_id": { + "type": "string" + }, + "creator": { + "$ref": "#/definitions/User" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "source_guild_id": { + "type": "string" + }, + "source_guild": { + "$ref": "#/definitions/Guild" + }, + "serialized_source_guild": { + "$ref": "#/definitions/Guild" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "created_at", + "creator", + "creator_id", + "id", + "name", + "serialized_source_guild", + "source_guild", + "source_guild_id", + "updated_at" + ] + }, + "Emoji": { + "type": "object", + "properties": { + "animated": { + "type": "boolean" + }, + "available": { + "type": "boolean" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "managed": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "require_colons": { + "type": "boolean" + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "groups": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "animated", + "available", + "groups", + "guild", + "guild_id", + "id", + "managed", + "name", + "require_colons", + "roles", + "user", + "user_id" + ] + }, + "GuildWelcomeScreen": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "welcome_channels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "channel_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel_id", + "description" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "enabled", + "welcome_channels" + ] + }, + "GuildMessagesSearchMessage": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/MessageType" + }, + "content": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "author": { + "$ref": "#/definitions/PublicUser" + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -230789,7 +235086,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -231551,7 +235848,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -232066,7 +236363,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -235032,7 +239329,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -235794,7 +240091,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -236309,7 +240606,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -239247,7 +243544,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -240009,7 +244306,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -240524,7 +244821,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -243452,7 +247749,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -244214,7 +248511,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -244729,7 +249026,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -247663,7 +251960,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -248425,7 +252722,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -248940,7 +253237,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -251885,7 +256182,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -252647,7 +256944,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -253162,7 +257459,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -256121,7 +260418,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -256883,7 +261180,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -257398,7 +261695,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -260328,7 +264625,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -261090,7 +265387,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -261605,7 +265902,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -264538,7 +268835,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -265300,7 +269597,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -265815,7 +270112,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -268777,7 +273074,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -269539,7 +273836,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -270054,7 +274351,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -272984,7 +277281,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -273746,7 +278043,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -274261,7 +278558,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -277270,7 +281567,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -278032,7 +282329,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -278547,7 +282844,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -281484,7 +285781,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -282246,7 +286543,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -282761,7 +287058,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -285691,7 +289988,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -286453,7 +290750,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -286968,7 +291265,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -289898,7 +294195,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -290660,7 +294957,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -291175,7 +295472,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -294112,7 +298409,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -294874,7 +299171,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -295389,7 +299686,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -298323,7 +302620,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -299085,7 +303382,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -299600,7 +303897,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -302530,7 +306827,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -303292,7 +307589,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -303807,7 +308104,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -306812,7 +311109,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -307574,7 +311871,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -308089,7 +312386,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -311030,7 +315327,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -311792,7 +316089,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -312307,7 +316604,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -315249,7 +319546,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -316011,7 +320308,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -316526,7 +320823,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -319518,7 +323815,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -320280,7 +324577,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -320795,7 +325092,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -323746,7 +328043,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -324508,7 +328805,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -325023,7 +329320,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -327980,7 +332277,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -328742,7 +333039,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -329257,7 +333554,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -332208,7 +336505,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -332970,7 +337267,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -333485,7 +337782,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -336415,7 +340712,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -337177,7 +341474,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -337692,7 +341989,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -340650,7 +344947,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -341412,7 +345709,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -341927,7 +346224,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -344897,7 +349194,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -345659,7 +349956,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -346174,7 +350471,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -349098,7 +353395,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -349860,7 +354157,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -350375,7 +354672,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -353309,7 +357606,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -354071,7 +358368,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -354586,7 +358883,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -357516,7 +361813,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -358278,7 +362575,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -358793,7 +363090,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -361730,7 +366027,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -362492,7 +366789,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -363007,7 +367304,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -366148,7 +370445,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -366910,7 +371207,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -367425,7 +371722,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -370346,7 +374643,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -371108,7 +375405,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -371623,7 +375920,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -374638,7 +378935,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -375400,7 +379697,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -375915,7 +380212,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -378839,7 +383136,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -379601,7 +383898,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -380116,7 +384413,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -383040,7 +387337,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -383802,7 +388099,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -384317,7 +388614,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -387241,7 +391538,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -388003,7 +392300,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -388518,7 +392815,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -391536,7 +395833,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -392298,7 +396595,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -392813,7 +397110,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -395735,7 +400032,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -396497,7 +400794,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -397012,7 +401309,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -399934,7 +404231,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -400696,7 +404993,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -401211,7 +405508,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -404133,7 +408430,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -404895,7 +409192,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -405410,7 +409707,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -408334,7 +412631,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -409096,7 +413393,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -409611,7 +413908,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -412535,7 +416832,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -413297,7 +417594,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -413812,7 +418109,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -416736,7 +421033,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -417498,7 +421795,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -418013,7 +422310,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -420937,7 +425234,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -421699,7 +425996,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -422214,7 +426511,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -425138,7 +429435,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -425900,7 +430197,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -426415,7 +430712,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -429403,7 +433700,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -430165,7 +434462,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -430680,7 +434977,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -433604,7 +437901,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -434366,7 +438663,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -434881,7 +439178,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -437805,7 +442102,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -438567,7 +442864,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -439082,7 +443379,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -442006,7 +446303,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -442768,7 +447065,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -443283,7 +447580,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -446254,7 +450551,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -447016,7 +451313,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -447531,7 +451828,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -450691,7 +454988,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -451453,7 +455750,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -451968,7 +456265,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -454892,7 +459189,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -455654,7 +459951,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -456169,7 +460466,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -459093,7 +463390,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -459855,7 +464152,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -460370,7 +464667,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -463294,7 +467591,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -464056,7 +468353,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -464571,7 +468868,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -467495,7 +471792,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -468257,7 +472554,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -468772,7 +473069,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -471722,7 +476019,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -472484,7 +476781,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -472999,7 +477296,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -475923,7 +480220,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -476685,7 +480982,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -477200,7 +481497,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -480145,7 +484442,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -480907,7 +485204,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -481422,7 +485719,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -484360,7 +488657,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -485122,7 +489419,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -485637,7 +489934,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -488687,7 +492984,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -489449,7 +493746,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -489964,7 +494261,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -492906,7 +497203,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -493668,7 +497965,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -494183,7 +498480,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -497131,7 +501428,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -497893,7 +502190,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -498408,7 +502705,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -501342,7 +505639,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -502104,7 +506401,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -502619,7 +506916,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -505553,7 +509850,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -506315,7 +510612,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -506830,7 +511127,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -509751,7 +514048,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -510513,7 +514810,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -511028,7 +515325,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -513961,7 +518258,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -514723,7 +519020,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -515238,7 +519535,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -518186,7 +522483,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -518948,7 +523245,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -519463,7 +523760,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -522415,7 +526712,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -523177,7 +527474,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -523692,7 +527989,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -526623,7 +530920,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -527385,7 +531682,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -527900,7 +532197,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -530830,7 +535127,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -531592,7 +535889,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -532107,7 +536404,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -535037,7 +539334,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -535799,7 +540096,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -536314,7 +540611,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -539250,7 +543547,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { @@ -540012,7 +544309,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -540527,7 +544824,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/definitions/Attachment_1" + "$ref": "#/definitions/Attachment" } }, "embeds": { diff --git a/src/api/middlewares/Authentication.ts b/src/api/middlewares/Authentication.ts index 9e41b453..a6cad51c 100644 --- a/src/api/middlewares/Authentication.ts +++ b/src/api/middlewares/Authentication.ts @@ -16,8 +16,8 @@ along with this program. If not, see . */ -import { checkToken, Rights } from "@spacebar/util"; import * as Sentry from "@sentry/node"; +import { checkToken, Rights } from "@spacebar/util"; import { NextFunction, Request, Response } from "express"; import { HTTPError } from "lambert-server"; @@ -32,7 +32,7 @@ export const NO_AUTHORIZATION_ROUTES = [ "/auth/forgot", "/auth/reset", // Routes with a seperate auth system - "/webhooks/", + /\/webhooks\/\d+\/\w+\/?/, // no token requires auth // Public information endpoints "/ping", "/gateway", diff --git a/src/api/routes/channels/#channel_id/webhooks.ts b/src/api/routes/channels/#channel_id/webhooks.ts index d54756a1..4c1ccbdf 100644 --- a/src/api/routes/channels/#channel_id/webhooks.ts +++ b/src/api/routes/channels/#channel_id/webhooks.ts @@ -26,8 +26,8 @@ import { WebhookCreateSchema, WebhookType, handleFile, - trimSpecial, isTextChannel, + trimSpecial, } from "@spacebar/util"; import crypto from "crypto"; import { Request, Response, Router } from "express"; @@ -35,10 +35,12 @@ import { HTTPError } from "lambert-server"; const router: Router = Router(); -//TODO: implement webhooks router.get( "/", route({ + description: + "Returns a list of channel webhook objects. Requires the MANAGE_WEBHOOKS permission.", + permission: "MANAGE_WEBHOOKS", responses: { 200: { body: "APIWebhookArray", @@ -46,7 +48,18 @@ router.get( }, }), async (req: Request, res: Response) => { - res.json([]); + const { channel_id } = req.params; + const webhooks = await Webhook.find({ + where: { channel_id }, + relations: [ + "user", + "guild", + "source_guild", + "application" /*"source_channel"*/, + ], + }); + + return res.json(webhooks); }, ); @@ -89,15 +102,15 @@ router.post( if (avatar) avatar = await handleFile(`/avatars/${channel_id}`, avatar); - const hook = Webhook.create({ + const hook = await Webhook.create({ type: WebhookType.Incoming, name, avatar, guild_id: channel.guild_id, channel_id: channel.id, user_id: req.user_id, - token: crypto.randomBytes(24).toString("base64"), - }); + token: crypto.randomBytes(24).toString("base64url"), + }).save(); const user = await User.getPublicUser(req.user_id); diff --git a/src/api/routes/guilds/#guild_id/webhooks.ts b/src/api/routes/guilds/#guild_id/webhooks.ts index d58659a4..a2ef7d69 100644 --- a/src/api/routes/guilds/#guild_id/webhooks.ts +++ b/src/api/routes/guilds/#guild_id/webhooks.ts @@ -16,12 +16,37 @@ along with this program. If not, see . */ -import { Router, Response, Request } from "express"; import { route } from "@spacebar/api"; +import { Webhook } from "@spacebar/util"; +import { Request, Response, Router } from "express"; const router = Router(); -//TODO: implement webhooks -router.get("/", route({}), async (req: Request, res: Response) => { - res.json([]); -}); +router.get( + "/", + route({ + description: + "Returns a list of guild webhook objects. Requires the MANAGE_WEBHOOKS permission.", + permission: "MANAGE_WEBHOOKS", + responses: { + 200: { + body: "APIWebhookArray", + }, + }, + }), + async (req: Request, res: Response) => { + const { guild_id } = req.params; + const webhooks = await Webhook.find({ + where: { guild_id }, + relations: [ + "user", + "guild", + "source_guild", + "application" /*"source_channel"*/, + ], + }); + + return res.json(webhooks); + }, +); + export default router; diff --git a/src/api/routes/webhooks/#webhook_id/#token/index.ts b/src/api/routes/webhooks/#webhook_id/#token/index.ts new file mode 100644 index 00000000..b47502b4 --- /dev/null +++ b/src/api/routes/webhooks/#webhook_id/#token/index.ts @@ -0,0 +1,215 @@ +import { handleMessage, route } from "@spacebar/api"; +import { + Attachment, + Config, + DiscordApiErrors, + FieldErrors, + Message, + Webhook, + WebhookExecuteSchema, + uploadFile, +} from "@spacebar/util"; +import { Request, Response, Router } from "express"; +import { HTTPError } from "lambert-server"; +import multer from "multer"; +import { MoreThan } from "typeorm"; +const router = Router(); + +router.get( + "/", + route({ + description: "Returns a webhook object for the given id.", + responses: { + 200: { + body: "APIWebhook", + }, + 404: {}, + }, + }), + async (req: Request, res: Response) => { + const { webhook_id, token } = req.params; + const webhook = await Webhook.findOne({ + where: { + id: webhook_id, + }, + relations: ["channel", "guild", "application"], + }); + + if (!webhook) { + throw DiscordApiErrors.UNKNOWN_WEBHOOK; + } + + if (webhook.token !== token) { + throw DiscordApiErrors.INVALID_WEBHOOK_TOKEN_PROVIDED; + } + + return res.json(webhook); + }, +); + +// TODO: config max upload size +const messageUpload = multer({ + limits: { + fileSize: Config.get().limits.message.maxAttachmentSize, + fields: 10, + // files: 1 + }, + storage: multer.memoryStorage(), +}); // max upload 50 mb + +// https://discord.com/developers/docs/resources/webhook#execute-webhook +router.post( + "/", + messageUpload.any(), + (req, res, next) => { + if (req.body.payload_json) { + req.body = JSON.parse(req.body.payload_json); + } + + next(); + }, + route({ + requestBody: "WebhookExecuteSchema", + query: { + wait: { + type: "boolean", + required: false, + description: + "waits for server confirmation of message send before response, and returns the created message body", + }, + thread_id: { + type: "string", + required: false, + description: + "Send a message to the specified thread within a webhook's channel.", + }, + }, + responses: { + 204: {}, + 400: { + body: "APIErrorResponse", + }, + 404: {}, + }, + }), + async (req: Request, res: Response) => { + const { webhook_id, token } = req.params; + const body = req.body as WebhookExecuteSchema; + const attachments: Attachment[] = []; + + // ensure one of content, embeds, components, or file is present + if ( + !body.content && + !body.embeds && + !body.components && + !body.file && + !body.attachments + ) { + throw DiscordApiErrors.CANNOT_SEND_EMPTY_MESSAGE; + } + + // block username from containing certain words + // TODO: configurable additions + const blockedContains = ["discord", "clyde", "spacebar"]; + for (const word of blockedContains) { + if (body.username?.toLowerCase().includes(word)) { + return res.status(400).json({ + username: [`Username cannot contain "${word}"`], + }); + } + } + + // block username from being certain words + // TODO: configurable additions + const blockedEquals = ["everyone", "here"]; + for (const word of blockedEquals) { + if (body.username?.toLowerCase() === word) { + return res.status(400).json({ + username: [`Username cannot be "${word}"`], + }); + } + } + + const webhook = await Webhook.findOne({ + where: { + id: webhook_id, + }, + relations: ["channel", "guild", "application"], + }); + + if (!webhook) { + throw DiscordApiErrors.UNKNOWN_WEBHOOK; + } + + if (!webhook.channel.isWritable()) { + throw new HTTPError( + `Cannot send messages to channel of type ${webhook.channel.type}`, + 400, + ); + } + + if (webhook.token !== token) { + throw DiscordApiErrors.INVALID_WEBHOOK_TOKEN_PROVIDED; + } + + // TODO: creating messages by users checks if the user can bypass rate limits, we cant do that on webhooks, but maybe we could check the application if there is one? + const limits = Config.get().limits; + if (limits.absoluteRate.register.enabled) { + const count = await Message.count({ + where: { + channel_id: webhook.channel_id, + timestamp: MoreThan( + new Date( + Date.now() - limits.absoluteRate.sendMessage.window, + ), + ), + }, + }); + + if (count >= limits.absoluteRate.sendMessage.limit) + throw FieldErrors({ + channel_id: { + code: "TOO_MANY_MESSAGES", + message: req.t("common:toomany.MESSAGE"), + }, + }); + } + + const files = (req.files as Express.Multer.File[]) ?? []; + for (const currFile of files) { + try { + const file = await uploadFile( + `/attachments/${webhook.channel.id}`, + currFile, + ); + attachments.push( + Attachment.create({ ...file, proxy_url: file.url }), + ); + } catch (error) { + return res.status(400).json({ message: error?.toString() }); + } + } + + // TODO: set username and avatar based on body + + const embeds = body.embeds || []; + const message = await handleMessage({ + ...body, + type: 0, + pinned: false, + webhook_id: webhook.id, + application_id: webhook.application?.id, + embeds, + channel_id: webhook.channel_id, + attachments, + timestamp: new Date(), + }); + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + //@ts-ignore dont care2 + message.edited_timestamp = null; + + webhook.channel.last_message_id = message.id; + }, +); + +export default router; diff --git a/src/api/routes/webhooks/#webhook_id/index.ts b/src/api/routes/webhooks/#webhook_id/index.ts new file mode 100644 index 00000000..cc8c0386 --- /dev/null +++ b/src/api/routes/webhooks/#webhook_id/index.ts @@ -0,0 +1,32 @@ +import { route } from "@spacebar/api"; +import { Webhook } from "@spacebar/util"; +import { Request, Response, Router } from "express"; +const router = Router(); + +router.get( + "/", + route({ + description: "Returns a webhook object for the given id.", + responses: { + 200: { + body: "APIWebhook", + }, + 404: {}, + }, + }), + async (req: Request, res: Response) => { + const { webhook_id } = req.params; + const webhook = await Webhook.findOneOrFail({ + where: { id: webhook_id }, + relations: [ + "user", + "guild", + "source_guild", + "application" /*"source_channel"*/, + ], + }); + return res.json(webhook); + }, +); + +export default router; diff --git a/src/util/schemas/MessageCreateSchema.ts b/src/util/schemas/MessageCreateSchema.ts index 57abf62f..8093a10a 100644 --- a/src/util/schemas/MessageCreateSchema.ts +++ b/src/util/schemas/MessageCreateSchema.ts @@ -18,7 +18,7 @@ import { Embed } from "@spacebar/util"; -type Attachment = { +export type MessageCreateAttachment = { id: string; filename: string; }; @@ -52,7 +52,7 @@ export interface MessageCreateSchema { TODO: we should create an interface for attachments TODO: OpenWAAO<-->attachment-style metadata conversion **/ - attachments?: Attachment[]; + attachments?: MessageCreateAttachment[]; sticker_ids?: string[]; // eslint-disable-next-line @typescript-eslint/no-explicit-any components?: any[]; diff --git a/src/util/schemas/WebhookCreateSchema.ts b/src/util/schemas/WebhookCreateSchema.ts index f92cb63e..7bd0afa8 100644 --- a/src/util/schemas/WebhookCreateSchema.ts +++ b/src/util/schemas/WebhookCreateSchema.ts @@ -16,7 +16,6 @@ along with this program. If not, see . */ -// TODO: webhooks export interface WebhookCreateSchema { /** * @maxLength 80 diff --git a/src/util/schemas/WebhookExecuteSchema.ts b/src/util/schemas/WebhookExecuteSchema.ts new file mode 100644 index 00000000..943cbe9e --- /dev/null +++ b/src/util/schemas/WebhookExecuteSchema.ts @@ -0,0 +1,46 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + +import { Embed } from "../entities"; +import { MessageCreateAttachment } from "./MessageCreateSchema"; + +export interface WebhookExecuteSchema { + content?: string; + username?: string; + avatar_url?: string; + tts?: boolean; + embeds?: Embed[]; + allowed_mentions?: { + parse?: string[]; + roles?: string[]; + users?: string[]; + replied_user?: boolean; + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + components?: any[]; + file?: { filename: string }; + payload_json?: string; + /** + TODO: we should create an interface for attachments + TODO: OpenWAAO<-->attachment-style metadata conversion + **/ + attachments?: MessageCreateAttachment[]; + flags?: number; + thread_name?: string; + applied_tags?: string[]; +} diff --git a/src/util/schemas/index.ts b/src/util/schemas/index.ts index 44a504cd..4812b535 100644 --- a/src/util/schemas/index.ts +++ b/src/util/schemas/index.ts @@ -79,5 +79,6 @@ export * from "./VoiceStateUpdateSchema"; export * from "./VoiceVideoSchema"; export * from "./WebAuthnSchema"; export * from "./WebhookCreateSchema"; +export * from "./WebhookExecuteSchema"; export * from "./WidgetModifySchema"; export * from "./responses"; diff --git a/src/util/util/Constants.ts b/src/util/util/Constants.ts index e68bb0b7..112b0cc4 100644 --- a/src/util/util/Constants.ts +++ b/src/util/util/Constants.ts @@ -576,7 +576,7 @@ export const DiscordApiErrors = { UNKNOWN_TOKEN: new ApiError("Unknown token", 10012), UNKNOWN_USER: new ApiError("Unknown user", 10013), UNKNOWN_EMOJI: new ApiError("Unknown emoji", 10014), - UNKNOWN_WEBHOOK: new ApiError("Unknown webhook", 10015), + UNKNOWN_WEBHOOK: new ApiError("Unknown webhook", 10015, 404), UNKNOWN_WEBHOOK_SERVICE: new ApiError("Unknown webhook service", 10016), UNKNOWN_CONNECTION: new ApiError("Unknown connection", 10017, 400), UNKNOWN_SESSION: new ApiError("Unknown session", 10020), From e7a98b6c46e3d4fdaa68bd8a04ffcf53a9dac184 Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Thu, 18 Jul 2024 12:42:07 +0200 Subject: [PATCH 2/8] webhook fixes & username/avatar property for msg --- assets/openapi.json | 416 +++++++- assets/schemas.json | 903 ++++++++++++++++++ .../webhooks/#webhook_id/#token/index.ts | 25 +- src/api/util/handlers/Message.ts | 119 ++- src/util/entities/Message.ts | 19 +- src/util/entities/Webhook.ts | 8 +- .../1721298824927-webhookMessageProperties.ts | 15 + .../1721298824927-webhookMessageProperties.ts | 15 + .../1721298824927-webhookMessageProperties.ts | 15 + 9 files changed, 1459 insertions(+), 76 deletions(-) create mode 100644 src/util/migration/mariadb/1721298824927-webhookMessageProperties.ts create mode 100644 src/util/migration/mysql/1721298824927-webhookMessageProperties.ts create mode 100644 src/util/migration/postgres/1721298824927-webhookMessageProperties.ts diff --git a/assets/openapi.json b/assets/openapi.json index 19686c59..6860c21b 100644 --- a/assets/openapi.json +++ b/assets/openapi.json @@ -1127,12 +1127,19 @@ "type": "boolean", "default": false }, + "channel_ordering": { + "type": "array", + "items": { + "type": "string" + } + }, "id": { "type": "string" } }, "required": [ "bans", + "channel_ordering", "channels", "emojis", "features", @@ -1203,9 +1210,6 @@ "default_auto_archive_duration": { "type": "integer" }, - "position": { - "type": "integer" - }, "permission_overwrites": { "type": "array", "items": { @@ -1272,6 +1276,10 @@ "type": "integer", "default": 0 }, + "position": { + "description": "Must be calculated Channel.calculatePosition", + "type": "integer" + }, "id": { "type": "string" } @@ -1280,11 +1288,11 @@ "created_at", "default_thread_rate_limit_per_user", "flags", - "guild", "id", "nsfw", "owner", "parent_id", + "position", "type" ] }, @@ -2138,7 +2146,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/components/schemas/Attachment_1" + "$ref": "#/components/schemas/Attachment" } }, "embeds": { @@ -2324,7 +2332,6 @@ } }, "required": [ - "avatar", "banner", "bio", "communication_disabled_until", @@ -2889,7 +2896,7 @@ ], "type": "number" }, - "Attachment_1": { + "Attachment": { "type": "object", "properties": { "filename": { @@ -3394,7 +3401,7 @@ "attachments": { "type": "array", "items": { - "$ref": "#/components/schemas/Attachment_1" + "$ref": "#/components/schemas/Attachment" } }, "embeds": { @@ -3473,6 +3480,9 @@ "type": "string", "format": "date-time" }, + "avatar": { + "type": "string" + }, "username": { "type": "string" }, @@ -3482,9 +3492,6 @@ "public_flags": { "type": "integer" }, - "avatar": { - "type": "string" - }, "accent_color": { "type": "integer" }, @@ -3721,6 +3728,9 @@ "banner": { "type": "string" }, + "description": { + "type": "string" + }, "unavailable": { "type": "boolean" }, @@ -3757,9 +3767,6 @@ "default_message_notifications": { "type": "integer" }, - "description": { - "type": "string" - }, "discovery_splash": { "type": "string" }, @@ -3852,12 +3859,19 @@ }, "premium_progress_bar_enabled": { "type": "boolean" + }, + "channel_ordering": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ "_do_validate", "assign", "bans", + "channel_ordering", "channels", "emojis", "features", @@ -5081,6 +5095,9 @@ "content": { "type": "string" }, + "mobile_network_type": { + "type": "string" + }, "nonce": { "type": "string" }, @@ -5191,6 +5208,10 @@ "items": { "type": "string" } + }, + "components": { + "type": "array", + "items": {} } } }, @@ -5218,6 +5239,9 @@ "content": { "type": "string" }, + "mobile_network_type": { + "type": "string" + }, "nonce": { "type": "string" }, @@ -5310,6 +5334,10 @@ "items": { "type": "string" } + }, + "components": { + "type": "array", + "items": {} } } }, @@ -5834,6 +5862,16 @@ "UserSettingsSchema": { "type": "object", "properties": { + "status": { + "enum": [ + "dnd", + "idle", + "invisible", + "offline", + "online" + ], + "type": "string" + }, "afk_timeout": { "type": "integer" }, @@ -5931,16 +5969,6 @@ "show_current_game": { "type": "boolean" }, - "status": { - "enum": [ - "dnd", - "idle", - "invisible", - "offline", - "online" - ], - "type": "string" - }, "stream_notifications_enabled": { "type": "boolean" }, @@ -6181,6 +6209,107 @@ "name" ] }, + "WebhookExecuteSchema": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "username": { + "type": "string" + }, + "avatar_url": { + "type": "string" + }, + "tts": { + "type": "boolean" + }, + "embeds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Embed" + } + }, + "allowed_mentions": { + "type": "object", + "properties": { + "parse": { + "type": "array", + "items": { + "type": "string" + } + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "items": { + "type": "string" + } + }, + "replied_user": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "components": { + "type": "array", + "items": {} + }, + "file": { + "type": "object", + "properties": { + "filename": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filename" + ] + }, + "payload_json": { + "type": "string" + }, + "attachments": { + "description": "TODO: we should create an interface for attachments\nTODO: OpenWAAO<-->attachment-style metadata conversion", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "filename": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filename", + "id" + ] + } + }, + "flags": { + "type": "integer" + }, + "thread_name": { + "type": "string" + }, + "applied_tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "WidgetModifySchema": { "type": "object", "properties": { @@ -6960,6 +7089,9 @@ "type": "string", "format": "date-time" }, + "avatar": { + "type": "string" + }, "verified": { "type": "boolean" }, @@ -6972,9 +7104,6 @@ "public_flags": { "type": "integer" }, - "avatar": { - "type": "string" - }, "accent_color": { "type": "integer" }, @@ -7077,6 +7206,9 @@ "type": "string", "format": "date-time" }, + "avatar": { + "type": "string" + }, "verified": { "type": "boolean" }, @@ -7089,9 +7221,6 @@ "public_flags": { "type": "integer" }, - "avatar": { - "type": "string" - }, "accent_color": { "type": "integer" }, @@ -7305,6 +7434,9 @@ "premium_since": { "type": "integer" }, + "avatar": { + "type": "string" + }, "user": { "$ref": "#/components/schemas/PublicUser" }, @@ -7533,12 +7665,19 @@ "type": "boolean", "default": false }, + "channel_ordering": { + "type": "array", + "items": { + "type": "string" + } + }, "id": { "type": "string" } }, "required": [ "bans", + "channel_ordering", "channels", "emojis", "features", @@ -7737,6 +7876,9 @@ "premium_since": { "type": "integer" }, + "avatar": { + "type": "string" + }, "user": { "$ref": "#/components/schemas/PublicUser" }, @@ -8037,9 +8179,175 @@ }, { "name": "voice" + }, + { + "name": "webhooks" } ], "paths": { + "/webhooks/{webhook_id}/": { + "get": { + "security": [ + { + "bearer": [] + } + ], + "description": "Returns a webhook object for the given id.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIWebhook" + } + } + } + }, + "404": { + "description": "No description available" + } + }, + "parameters": [ + { + "name": "webhook_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "webhook_id" + } + ], + "tags": [ + "webhooks" + ] + } + }, + "/webhooks/{webhook_id}/{token}/": { + "get": { + "security": [ + { + "bearer": [] + } + ], + "description": "Returns a webhook object for the given id.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIWebhook" + } + } + } + }, + "404": { + "description": "No description available" + } + }, + "parameters": [ + { + "name": "webhook_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "webhook_id" + }, + { + "name": "token", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "token" + } + ], + "tags": [ + "webhooks" + ] + }, + "post": { + "security": [ + { + "bearer": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebhookExecuteSchema" + } + } + } + }, + "responses": { + "204": { + "description": "No description available" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIErrorResponse" + } + } + } + }, + "404": { + "description": "No description available" + } + }, + "parameters": [ + { + "name": "webhook_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "webhook_id" + }, + { + "name": "token", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "token" + }, + { + "name": "wait", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + }, + "description": "waits for server confirmation of message send before response, and returns the created message body" + }, + { + "name": "thread_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "description": "Send a message to the specified thread within a webhook's channel." + } + ], + "tags": [ + "webhooks" + ] + } + }, "/voice/regions/": { "get": { "security": [ @@ -10189,6 +10497,15 @@ } } }, + "parameters": [ + { + "name": "client_id", + "in": "query", + "schema": { + "type": "string" + } + } + ], "tags": [ "oauth2" ] @@ -10265,6 +10582,30 @@ ] } }, + "/oauth2/applications/@me/": { + "get": { + "security": [ + { + "bearer": [] + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Application" + } + } + } + } + }, + "tags": [ + "oauth2" + ] + } + }, "/invites/{code}": { "get": { "security": [ @@ -10879,14 +11220,23 @@ }, "/guilds/{guild_id}/webhooks/": { "get": { + "x-permission-required": "MANAGE_WEBHOOKS", "security": [ { "bearer": [] } ], + "description": "Returns a list of guild webhook objects. Requires the MANAGE_WEBHOOKS permission.", "responses": { - "default": { - "description": "No description available" + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIWebhookArray" + } + } + } } }, "parameters": [ @@ -14363,11 +14713,13 @@ }, "/channels/{channel_id}/webhooks/": { "get": { + "x-permission-required": "MANAGE_WEBHOOKS", "security": [ { "bearer": [] } ], + "description": "Returns a list of channel webhook objects. Requires the MANAGE_WEBHOOKS permission.", "responses": { "200": { "description": "", diff --git a/assets/schemas.json b/assets/schemas.json index 018ddaca..39961d30 100644 --- a/assets/schemas.json +++ b/assets/schemas.json @@ -2379,6 +2379,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -2704,6 +2710,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -6598,6 +6605,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -6923,6 +6936,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -10817,6 +10831,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -11142,6 +11162,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -15031,6 +15052,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -15356,6 +15383,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -19281,6 +19309,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -19606,6 +19640,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -23500,6 +23535,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -23825,6 +23866,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -27710,6 +27752,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -28035,6 +28083,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -31923,6 +31972,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -32248,6 +32303,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -36145,6 +36201,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -36470,6 +36532,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -40355,6 +40418,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -40680,6 +40749,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -44565,6 +44635,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -44890,6 +44966,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -48794,6 +48871,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -49119,6 +49202,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -53007,6 +53091,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -53332,6 +53422,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -57280,6 +57371,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -57605,6 +57702,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -61512,6 +61610,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -61837,6 +61941,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -65885,6 +65990,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -66210,6 +66321,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -70116,6 +70228,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -70441,6 +70559,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -74357,6 +74476,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -74682,6 +74807,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -78580,6 +78706,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -78905,6 +79037,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -82809,6 +82942,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -83134,6 +83273,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -87028,6 +87168,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -87353,6 +87499,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -91235,6 +91382,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -91560,6 +91713,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -95560,6 +95714,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -95885,6 +96045,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -99882,6 +100043,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -100207,6 +100374,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -104092,6 +104260,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -104417,6 +104591,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -108310,6 +108485,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -108635,6 +108816,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -112521,6 +112703,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -112846,6 +113034,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -116732,6 +116921,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -117057,6 +117252,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -120978,6 +121174,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -121303,6 +121505,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -125189,6 +125392,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -125514,6 +125723,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -129399,6 +129609,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -129724,6 +129940,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -133624,6 +133841,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -133949,6 +134172,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -137838,6 +138062,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -138163,6 +138393,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -142126,6 +142357,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -142451,6 +142688,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -146336,6 +146574,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -146661,6 +146905,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -150546,6 +150791,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -150871,6 +151122,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -154753,6 +155005,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -155078,6 +155336,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -158966,6 +159225,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -159291,6 +159556,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -163189,6 +163455,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -163514,6 +163786,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -167396,6 +167669,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -167721,6 +168000,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -171652,6 +171932,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -171977,6 +172263,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -175894,6 +176181,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -176219,6 +176512,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -180101,6 +180395,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -180426,6 +180726,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -184333,6 +184634,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -184658,6 +184965,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -188654,6 +188962,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -188979,6 +189293,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -192860,6 +193175,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -193185,6 +193506,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -197105,6 +197427,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -197430,6 +197758,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -201338,6 +201667,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -201663,6 +201998,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -205623,6 +205959,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -205948,6 +206290,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -209830,6 +210173,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -210155,6 +210504,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -214045,6 +214395,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -214370,6 +214726,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -218250,6 +218607,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -218575,6 +218938,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -222461,6 +222825,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -222786,6 +223156,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -226672,6 +227043,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -226997,6 +227374,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -230969,6 +231347,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -231294,6 +231678,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -235180,6 +235565,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -235505,6 +235896,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -239423,6 +239815,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -239748,6 +240146,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -243638,6 +244037,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -243963,6 +244368,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -247843,6 +248249,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -248168,6 +248580,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -252054,6 +252467,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -252379,6 +252798,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -256276,6 +256696,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -256601,6 +257027,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -260512,6 +260939,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -260837,6 +261270,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -264719,6 +265153,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -265044,6 +265484,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -268929,6 +269370,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -269254,6 +269701,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -273168,6 +273616,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -273493,6 +273947,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -277375,6 +277830,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -277700,6 +278161,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -281661,6 +282123,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -281986,6 +282454,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -285875,6 +286344,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -286200,6 +286675,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -290082,6 +290558,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -290407,6 +290889,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -294289,6 +294772,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -294614,6 +295103,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -298503,6 +298993,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -298828,6 +299324,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -302714,6 +303211,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -303039,6 +303542,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -306921,6 +307425,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -307246,6 +307756,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -311203,6 +311714,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -311528,6 +312045,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -315421,6 +315939,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -315746,6 +316270,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -319640,6 +320165,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -319965,6 +320496,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -323909,6 +324441,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -324234,6 +324772,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -328137,6 +328676,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -328462,6 +329007,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -332371,6 +332917,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -332696,6 +333248,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -336599,6 +337152,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -336924,6 +337483,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -340806,6 +341366,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -341131,6 +341697,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -345041,6 +345608,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -345366,6 +345939,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -349288,6 +349862,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -349613,6 +350193,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -353489,6 +354070,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -353814,6 +354401,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -357700,6 +358288,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -358025,6 +358619,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -361907,6 +362502,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -362232,6 +362833,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -366121,6 +366723,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -366446,6 +367054,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -370539,6 +371148,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -370864,6 +371479,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -374737,6 +375353,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -375062,6 +375684,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -379029,6 +379652,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -379354,6 +379983,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -383230,6 +383860,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -383555,6 +384191,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -387431,6 +388068,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -387756,6 +388399,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -391632,6 +392276,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -391957,6 +392607,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -395927,6 +396578,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -396252,6 +396909,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -400126,6 +400784,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -400451,6 +401115,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -404325,6 +404990,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -404650,6 +405321,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -408524,6 +409196,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -408849,6 +409527,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -412725,6 +413404,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -413050,6 +413735,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -416926,6 +417612,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -417251,6 +417943,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -421127,6 +421820,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -421452,6 +422151,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -425328,6 +426028,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -425653,6 +426359,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -429529,6 +430236,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -429854,6 +430567,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -433794,6 +434508,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -434119,6 +434839,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -437995,6 +438716,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -438320,6 +439047,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -442196,6 +442924,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -442521,6 +443255,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -446397,6 +447132,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -446722,6 +447463,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -450645,6 +451387,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -450970,6 +451718,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -455082,6 +455831,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -455407,6 +456162,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -459283,6 +460039,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -459608,6 +460370,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -463484,6 +464247,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -463809,6 +464578,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -467685,6 +468455,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -468010,6 +468786,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -471886,6 +472663,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -472211,6 +472994,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -476113,6 +476897,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -476438,6 +477228,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -480314,6 +481105,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -480639,6 +481436,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -484536,6 +485334,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -484861,6 +485665,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -488751,6 +489556,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -489076,6 +489887,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -493078,6 +493890,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -493403,6 +494221,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -497297,6 +498116,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -497622,6 +498447,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -501522,6 +502348,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -501847,6 +502679,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -505733,6 +506566,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -506058,6 +506897,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -509944,6 +510784,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -510269,6 +511115,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -514142,6 +514989,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -514467,6 +515320,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -518352,6 +519206,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -518677,6 +519537,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -522577,6 +523438,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -522902,6 +523769,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -526806,6 +527674,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -527131,6 +528005,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -531014,6 +531889,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -531339,6 +532220,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -535221,6 +536103,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -535546,6 +536434,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -539428,6 +540317,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -539753,6 +540648,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", @@ -543641,6 +544537,12 @@ "$ref": "#/definitions/MessageComponent" } }, + "username": { + "type": "string" + }, + "avatar": { + "type": "string" + }, "id": { "type": "string" } @@ -543966,6 +544868,7 @@ "guild", "guild_id", "id", + "name", "source_guild", "source_guild_id", "type", diff --git a/src/api/routes/webhooks/#webhook_id/#token/index.ts b/src/api/routes/webhooks/#webhook_id/#token/index.ts index b47502b4..538ee181 100644 --- a/src/api/routes/webhooks/#webhook_id/#token/index.ts +++ b/src/api/routes/webhooks/#webhook_id/#token/index.ts @@ -1,12 +1,14 @@ -import { handleMessage, route } from "@spacebar/api"; +import { handleMessage, postHandleMessage, route } from "@spacebar/api"; import { Attachment, Config, DiscordApiErrors, FieldErrors, Message, + MessageCreateEvent, Webhook, WebhookExecuteSchema, + emitEvent, uploadFile, } from "@spacebar/util"; import { Request, Response, Router } from "express"; @@ -93,7 +95,11 @@ router.post( }, }), async (req: Request, res: Response) => { + const { wait, thread_id } = req.query; + if (!wait) return res.status(204).send(); + const { webhook_id, token } = req.params; + const body = req.body as WebhookExecuteSchema; const attachments: Attachment[] = []; @@ -200,6 +206,7 @@ router.post( webhook_id: webhook.id, application_id: webhook.application?.id, embeds, + // TODO: Support thread_id/thread_name once threads are implemented channel_id: webhook.channel_id, attachments, timestamp: new Date(), @@ -209,6 +216,22 @@ router.post( message.edited_timestamp = null; webhook.channel.last_message_id = message.id; + + await Promise.all([ + message.save(), + emitEvent({ + event: "MESSAGE_CREATE", + channel_id: webhook.channel_id, + data: message, + } as MessageCreateEvent), + ]); + + // no await as it shouldnt block the message send function and silently catch error + postHandleMessage(message).catch((e) => + console.error("[Message] post-message handler failed", e), + ); + + return res.json(message); }, ); diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts index 6172a3d0..18616506 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts @@ -1,17 +1,17 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ @@ -41,11 +41,13 @@ import { Sticker, MessageCreateSchema, EmbedCache, + handleFile, } from "@spacebar/util"; import { HTTPError } from "lambert-server"; import { In } from "typeorm"; import { EmbedHandlers } from "@spacebar/api"; import * as Sentry from "@sentry/node"; +import fetch from "node-fetch"; const allow_empty = false; // TODO: check webhook, application, system author, stickers // TODO: embed gifs/videos/images @@ -92,44 +94,89 @@ export async function handleMessage(opts: MessageOptions): Promise { where: { id: opts.application_id }, }); } + + let permission: any; if (opts.webhook_id) { message.webhook = await Webhook.findOneOrFail({ where: { id: opts.webhook_id }, }); - } - const permission = await getPermission( - opts.author_id, - channel.guild_id, - opts.channel_id, - ); - permission.hasThrow("SEND_MESSAGES"); - if (permission.cache.member) { - message.member = permission.cache.member; - } + message.author = (await User.findOne({ + where: { id: opts.webhook_id }, + })) || undefined; - if (opts.tts) permission.hasThrow("SEND_TTS_MESSAGES"); - if (opts.message_reference) { - permission.hasThrow("READ_MESSAGE_HISTORY"); - // code below has to be redone when we add custom message routing - if (message.guild_id !== null) { - const guild = await Guild.findOneOrFail({ - where: { id: channel.guild_id }, + if (!message.author) { + message.author = User.create({ + id: opts.webhook_id, + username: message.webhook.name, + discriminator: "0000", + avatar: message.webhook.avatar, + public_flags: 0, + premium: false, + premium_type: 0, + bot: true, + created_at: new Date(), + verified: true, + rights: "0", + data: { + valid_tokens_since: new Date(), + }, }); - if (!guild.features.includes("CROSS_CHANNEL_REPLIES")) { - if (opts.message_reference.guild_id !== channel.guild_id) - throw new HTTPError( - "You can only reference messages from this guild", - ); - if (opts.message_reference.channel_id !== opts.channel_id) - throw new HTTPError( - "You can only reference messages from this channel", - ); - } + + await message.author.save(); + } + + if (opts.username) { + message.username = opts.username; + message.author.username = message.username; + } + if (opts.avatar_url) { + const avatarData = await fetch(opts.avatar_url); + const base64 = await avatarData.buffer().then((x) => x.toString("base64")); + + const dataUri = "data:" + avatarData.headers.get("content-type") + ";base64," + base64; + + message.avatar = await handleFile( + `/avatars/${opts.webhook_id}`, + dataUri as string, + ); + console.log(message.avatar); + message.author.avatar = message.avatar; + } + } else { + permission = await getPermission( + opts.author_id, + channel.guild_id, + opts.channel_id, + ); + permission.hasThrow("SEND_MESSAGES"); + if (permission.cache.member) { + message.member = permission.cache.member; + } + + if (opts.tts) permission.hasThrow("SEND_TTS_MESSAGES"); + if (opts.message_reference) { + permission.hasThrow("READ_MESSAGE_HISTORY"); + // code below has to be redone when we add custom message routing + if (message.guild_id !== null) { + const guild = await Guild.findOneOrFail({ + where: { id: channel.guild_id }, + }); + if (!guild.features.includes("CROSS_CHANNEL_REPLIES")) { + if (opts.message_reference.guild_id !== channel.guild_id) + throw new HTTPError( + "You can only reference messages from this guild", + ); + if (opts.message_reference.channel_id !== opts.channel_id) + throw new HTTPError( + "You can only reference messages from this channel", + ); + } + } + /** Q: should be checked if the referenced message exists? ANSWER: NO + otherwise backfilling won't work **/ + message.type = MessageType.REPLY; } - /** Q: should be checked if the referenced message exists? ANSWER: NO - otherwise backfilling won't work **/ - message.type = MessageType.REPLY; } // TODO: stickers/activity @@ -172,14 +219,14 @@ export async function handleMessage(opts: MessageOptions): Promise { const role = await Role.findOneOrFail({ where: { id: mention, guild_id: channel.guild_id }, }); - if (role.mentionable || permission.has("MANAGE_ROLES")) { + if (role.mentionable || (opts.webhook_id || permission.has("MANAGE_ROLES"))) { mention_role_ids.push(mention); } }, ), ); - if (permission.has("MENTION_EVERYONE")) { + if (opts.webhook_id || permission.has("MENTION_EVERYONE")) { mention_everyone = !!content.match(EVERYONE_MENTION) || !!content.match(HERE_MENTION); @@ -302,4 +349,6 @@ interface MessageOptions extends MessageCreateSchema { attachments?: Attachment[]; edited_timestamp?: Date; timestamp?: Date; + username?: string; + avatar_url?: string; } diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts index b519099a..86238e53 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts @@ -1,17 +1,17 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ @@ -218,6 +218,12 @@ export class Message extends BaseClass { @Column({ type: "simple-json", nullable: true }) components?: MessageComponent[]; + @Column({ nullable: true }) + username?: string; + + @Column({ nullable: true }) + avatar?: string; + toJSON(): Message { return { ...this, @@ -234,7 +240,12 @@ export class Message extends BaseClass { reactions: this.reactions ?? undefined, sticker_items: this.sticker_items ?? undefined, message_reference: this.message_reference ?? undefined, - author: this.author?.toPublicUser() ?? undefined, + author: { + ...this.author?.toPublicUser() ?? undefined, + // Webhooks + username: this.username ?? this.author?.username, + avatar: this.avatar ?? this.author?.avatar, + }, activity: this.activity ?? undefined, application: this.application ?? undefined, components: this.components ?? undefined, diff --git a/src/util/entities/Webhook.ts b/src/util/entities/Webhook.ts index 91498a22..b7fba53a 100644 --- a/src/util/entities/Webhook.ts +++ b/src/util/entities/Webhook.ts @@ -1,17 +1,17 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ @@ -35,7 +35,7 @@ export class Webhook extends BaseClass { type: WebhookType; @Column({ nullable: true }) - name?: string; + name: string; @Column({ nullable: true }) avatar?: string; diff --git a/src/util/migration/mariadb/1721298824927-webhookMessageProperties.ts b/src/util/migration/mariadb/1721298824927-webhookMessageProperties.ts new file mode 100644 index 00000000..ccbe689a --- /dev/null +++ b/src/util/migration/mariadb/1721298824927-webhookMessageProperties.ts @@ -0,0 +1,15 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class WebhookMessageProperties1721298824927 implements MigrationInterface { + name = "WebhookMessageProperties1721298824927"; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query("ALTER TABLE `messages` ADD `username` text NULL"); + await queryRunner.query("ALTER TABLE `messages` ADD `avatar` text NULL"); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query("ALTER TABLE `messages` DROP COLUMN `username`"); + await queryRunner.query("ALTER TABLE `messages` DROP COLUMN `avatar`"); + } +} diff --git a/src/util/migration/mysql/1721298824927-webhookMessageProperties.ts b/src/util/migration/mysql/1721298824927-webhookMessageProperties.ts new file mode 100644 index 00000000..ccbe689a --- /dev/null +++ b/src/util/migration/mysql/1721298824927-webhookMessageProperties.ts @@ -0,0 +1,15 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class WebhookMessageProperties1721298824927 implements MigrationInterface { + name = "WebhookMessageProperties1721298824927"; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query("ALTER TABLE `messages` ADD `username` text NULL"); + await queryRunner.query("ALTER TABLE `messages` ADD `avatar` text NULL"); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query("ALTER TABLE `messages` DROP COLUMN `username`"); + await queryRunner.query("ALTER TABLE `messages` DROP COLUMN `avatar`"); + } +} diff --git a/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts b/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts new file mode 100644 index 00000000..46c507d4 --- /dev/null +++ b/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts @@ -0,0 +1,15 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class WebhookMessageProperties1721298824927 implements MigrationInterface { + name = "WebhookMessageProperties1721298824927"; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query("ALTER TABLE messages ADD username text NULL"); + await queryRunner.query("ALTER TABLE messages ADD avatar text NULL"); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query("ALTER TABLE messages DROP COLUMN username"); + await queryRunner.query("ALTER TABLE messages DROP COLUMN avatar"); + } +} From 6be3714593d282b4ac9881005a358355f729aa0d Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Thu, 18 Jul 2024 12:52:00 +0200 Subject: [PATCH 3/8] Fix ESLint & prettier --- .../webhooks/#webhook_id/#token/index.ts | 2 +- src/api/routes/webhooks/#webhook_id/index.ts | 1 + src/api/util/handlers/Message.ts | 28 +++++++++++++------ src/util/entities/Message.ts | 2 +- .../1721298824927-webhookMessageProperties.ts | 16 ++++++++--- .../1721298824927-webhookMessageProperties.ts | 16 ++++++++--- .../1721298824927-webhookMessageProperties.ts | 4 ++- 7 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/api/routes/webhooks/#webhook_id/#token/index.ts b/src/api/routes/webhooks/#webhook_id/#token/index.ts index 538ee181..49c47cca 100644 --- a/src/api/routes/webhooks/#webhook_id/#token/index.ts +++ b/src/api/routes/webhooks/#webhook_id/#token/index.ts @@ -95,7 +95,7 @@ router.post( }, }), async (req: Request, res: Response) => { - const { wait, thread_id } = req.query; + const { wait } = req.query; if (!wait) return res.status(204).send(); const { webhook_id, token } = req.params; diff --git a/src/api/routes/webhooks/#webhook_id/index.ts b/src/api/routes/webhooks/#webhook_id/index.ts index cc8c0386..7d528dbf 100644 --- a/src/api/routes/webhooks/#webhook_id/index.ts +++ b/src/api/routes/webhooks/#webhook_id/index.ts @@ -15,6 +15,7 @@ router.get( }, }), async (req: Request, res: Response) => { + // TODO: Permission check const { webhook_id } = req.params; const webhook = await Webhook.findOneOrFail({ where: { id: webhook_id }, diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts index 18616506..0a20fbc8 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts @@ -42,6 +42,7 @@ import { MessageCreateSchema, EmbedCache, handleFile, + Permissions, } from "@spacebar/util"; import { HTTPError } from "lambert-server"; import { In } from "typeorm"; @@ -95,15 +96,16 @@ export async function handleMessage(opts: MessageOptions): Promise { }); } - let permission: any; + let permission: undefined | Permissions; if (opts.webhook_id) { message.webhook = await Webhook.findOneOrFail({ where: { id: opts.webhook_id }, }); - message.author = (await User.findOne({ - where: { id: opts.webhook_id }, - })) || undefined; + message.author = + (await User.findOne({ + where: { id: opts.webhook_id }, + })) || undefined; if (!message.author) { message.author = User.create({ @@ -132,9 +134,15 @@ export async function handleMessage(opts: MessageOptions): Promise { } if (opts.avatar_url) { const avatarData = await fetch(opts.avatar_url); - const base64 = await avatarData.buffer().then((x) => x.toString("base64")); + const base64 = await avatarData + .buffer() + .then((x) => x.toString("base64")); - const dataUri = "data:" + avatarData.headers.get("content-type") + ";base64," + base64; + const dataUri = + "data:" + + avatarData.headers.get("content-type") + + ";base64," + + base64; message.avatar = await handleFile( `/avatars/${opts.webhook_id}`, @@ -219,14 +227,18 @@ export async function handleMessage(opts: MessageOptions): Promise { const role = await Role.findOneOrFail({ where: { id: mention, guild_id: channel.guild_id }, }); - if (role.mentionable || (opts.webhook_id || permission.has("MANAGE_ROLES"))) { + if ( + role.mentionable || + opts.webhook_id || + permission?.has("MANAGE_ROLES") + ) { mention_role_ids.push(mention); } }, ), ); - if (opts.webhook_id || permission.has("MENTION_EVERYONE")) { + if (opts.webhook_id || permission?.has("MENTION_EVERYONE")) { mention_everyone = !!content.match(EVERYONE_MENTION) || !!content.match(HERE_MENTION); diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts index 86238e53..6f712023 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts @@ -241,7 +241,7 @@ export class Message extends BaseClass { sticker_items: this.sticker_items ?? undefined, message_reference: this.message_reference ?? undefined, author: { - ...this.author?.toPublicUser() ?? undefined, + ...(this.author?.toPublicUser() ?? undefined), // Webhooks username: this.username ?? this.author?.username, avatar: this.avatar ?? this.author?.avatar, diff --git a/src/util/migration/mariadb/1721298824927-webhookMessageProperties.ts b/src/util/migration/mariadb/1721298824927-webhookMessageProperties.ts index ccbe689a..775847e0 100644 --- a/src/util/migration/mariadb/1721298824927-webhookMessageProperties.ts +++ b/src/util/migration/mariadb/1721298824927-webhookMessageProperties.ts @@ -1,15 +1,23 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -export class WebhookMessageProperties1721298824927 implements MigrationInterface { +export class WebhookMessageProperties1721298824927 + implements MigrationInterface +{ name = "WebhookMessageProperties1721298824927"; public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query("ALTER TABLE `messages` ADD `username` text NULL"); - await queryRunner.query("ALTER TABLE `messages` ADD `avatar` text NULL"); + await queryRunner.query( + "ALTER TABLE `messages` ADD `username` text NULL", + ); + await queryRunner.query( + "ALTER TABLE `messages` ADD `avatar` text NULL", + ); } public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query("ALTER TABLE `messages` DROP COLUMN `username`"); + await queryRunner.query( + "ALTER TABLE `messages` DROP COLUMN `username`", + ); await queryRunner.query("ALTER TABLE `messages` DROP COLUMN `avatar`"); } } diff --git a/src/util/migration/mysql/1721298824927-webhookMessageProperties.ts b/src/util/migration/mysql/1721298824927-webhookMessageProperties.ts index ccbe689a..775847e0 100644 --- a/src/util/migration/mysql/1721298824927-webhookMessageProperties.ts +++ b/src/util/migration/mysql/1721298824927-webhookMessageProperties.ts @@ -1,15 +1,23 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -export class WebhookMessageProperties1721298824927 implements MigrationInterface { +export class WebhookMessageProperties1721298824927 + implements MigrationInterface +{ name = "WebhookMessageProperties1721298824927"; public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query("ALTER TABLE `messages` ADD `username` text NULL"); - await queryRunner.query("ALTER TABLE `messages` ADD `avatar` text NULL"); + await queryRunner.query( + "ALTER TABLE `messages` ADD `username` text NULL", + ); + await queryRunner.query( + "ALTER TABLE `messages` ADD `avatar` text NULL", + ); } public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query("ALTER TABLE `messages` DROP COLUMN `username`"); + await queryRunner.query( + "ALTER TABLE `messages` DROP COLUMN `username`", + ); await queryRunner.query("ALTER TABLE `messages` DROP COLUMN `avatar`"); } } diff --git a/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts b/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts index 46c507d4..bd603f10 100644 --- a/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts +++ b/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts @@ -1,6 +1,8 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -export class WebhookMessageProperties1721298824927 implements MigrationInterface { +export class WebhookMessageProperties1721298824927 + implements MigrationInterface +{ name = "WebhookMessageProperties1721298824927"; public async up(queryRunner: QueryRunner): Promise { From 59c42c950b76ed99b3349ff64d98f979c75b2701 Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Thu, 18 Jul 2024 13:31:04 +0200 Subject: [PATCH 4/8] try manual conflict resolving --- src/util/entities/Message.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts index 6f712023..4a1ed5b4 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts @@ -218,6 +218,9 @@ export class Message extends BaseClass { @Column({ type: "simple-json", nullable: true }) components?: MessageComponent[]; + @Column({ type: "simple-json", nullable: true }) + poll?: Poll; + @Column({ nullable: true }) username?: string; From 15a2e57b05223f93361fe01bb3bf42e90cea3483 Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Thu, 18 Jul 2024 14:42:22 +0200 Subject: [PATCH 5/8] Prettier & fix merge util/handlers/Message --- src/api/util/handlers/Message.ts | 58 +++++++++++++++++--------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts index 9b267928..461cddb4 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts @@ -43,16 +43,12 @@ import { //CHANNEL_MENTION, USER_MENTION, Webhook, - Attachment, - Config, - Sticker, - MessageCreateSchema, - EmbedCache, + handleFile, + Permissions, } from "@spacebar/util"; import { HTTPError } from "lambert-server"; import { In } from "typeorm"; -import { EmbedHandlers } from "@spacebar/api"; -import * as Sentry from "@sentry/node"; +import fetch from "node-fetch"; const allow_empty = false; // TODO: check webhook, application, system author, stickers // TODO: embed gifs/videos/images @@ -167,28 +163,36 @@ export async function handleMessage(opts: MessageOptions): Promise { message.member = permission.cache.member; } - if (opts.tts) permission.hasThrow("SEND_TTS_MESSAGES"); - if (opts.message_reference) { - permission.hasThrow("READ_MESSAGE_HISTORY"); - // code below has to be redone when we add custom message routing - if (message.guild_id !== null) { - const guild = await Guild.findOneOrFail({ - where: { id: channel.guild_id }, - }); - if (!guild.features.includes("CROSS_CHANNEL_REPLIES")) { - if (opts.message_reference.guild_id !== channel.guild_id) - throw new HTTPError( - "You can only reference messages from this guild", - ); - if (opts.message_reference.channel_id !== opts.channel_id) - throw new HTTPError( - "You can only reference messages from this channel", - ); + if (opts.tts) permission.hasThrow("SEND_TTS_MESSAGES"); + if (opts.message_reference) { + permission.hasThrow("READ_MESSAGE_HISTORY"); + // code below has to be redone when we add custom message routing + if (message.guild_id !== null) { + const guild = await Guild.findOneOrFail({ + where: { id: channel.guild_id }, + }); + if (!opts.message_reference.guild_id) + opts.message_reference.guild_id = channel.guild_id; + if (!opts.message_reference.channel_id) + opts.message_reference.channel_id = opts.channel_id; + + if (!guild.features.includes("CROSS_CHANNEL_REPLIES")) { + if (opts.message_reference.guild_id !== channel.guild_id) + throw new HTTPError( + "You can only reference messages from this guild", + ); + if (opts.message_reference.channel_id !== opts.channel_id) + throw new HTTPError( + "You can only reference messages from this channel", + ); + } + + message.message_reference = opts.message_reference; } + /** Q: should be checked if the referenced message exists? ANSWER: NO + otherwise backfilling won't work **/ + message.type = MessageType.REPLY; } - /** Q: should be checked if the referenced message exists? ANSWER: NO - otherwise backfilling won't work **/ - message.type = MessageType.REPLY; } // TODO: stickers/activity From 873107f90d44f907f5964b8c0a95261224a74759 Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:16:50 +0200 Subject: [PATCH 6/8] Perms for GET webhook, url property --- assets/openapi.json | 8 +- assets/schemas.json | 864 ++++++++++++------ .../webhooks/#webhook_id/#token/index.ts | 9 +- src/api/routes/webhooks/#webhook_id/index.ts | 34 +- src/api/util/handlers/Message.ts | 1 - src/util/entities/Webhook.ts | 8 +- 6 files changed, 618 insertions(+), 306 deletions(-) diff --git a/assets/openapi.json b/assets/openapi.json index 9bcb54a5..5cf31327 100644 --- a/assets/openapi.json +++ b/assets/openapi.json @@ -2582,6 +2582,9 @@ "source_guild": { "$ref": "#/components/schemas/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -2589,10 +2592,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -8778,7 +8780,7 @@ "bearer": [] } ], - "description": "Returns a webhook object for the given id.", + "description": "Returns a webhook object for the given id and token.", "responses": { "200": { "description": "", diff --git a/assets/schemas.json b/assets/schemas.json index bfc7550c..cd3a018f 100644 --- a/assets/schemas.json +++ b/assets/schemas.json @@ -2697,6 +2697,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -2705,10 +2708,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -7269,6 +7271,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -7277,10 +7282,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -11786,6 +11790,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -11794,10 +11801,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -16281,6 +16287,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -16289,10 +16298,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -20798,6 +20806,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -20806,10 +20817,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -25307,6 +25317,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -25315,10 +25328,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -29846,6 +29858,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -29854,10 +29869,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -34349,6 +34363,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -34357,10 +34374,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -38855,6 +38871,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -38863,10 +38882,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -43373,6 +43391,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -43381,10 +43402,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -47894,6 +47914,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -47902,10 +47925,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -52397,6 +52419,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -52405,10 +52430,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -57002,6 +57026,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -57010,10 +57037,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -61517,6 +61543,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -61525,10 +61554,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -66032,6 +66060,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -66040,10 +66071,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -70542,6 +70572,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -70550,10 +70583,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -75088,6 +75120,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -75096,10 +75131,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -79603,6 +79637,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -79611,10 +79648,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -84109,6 +84145,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -84117,10 +84156,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -88618,6 +88656,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -88626,10 +88667,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -93136,6 +93176,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -93144,10 +93187,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -97642,6 +97684,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -97650,10 +97695,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -102148,6 +102192,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -102156,10 +102203,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -106673,6 +106719,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -106681,10 +106730,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -111182,6 +111230,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -111190,10 +111241,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -115751,6 +115801,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -115759,10 +115812,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -120279,6 +120331,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -120287,10 +120342,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -124948,6 +125002,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -124956,10 +125013,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -129475,6 +129531,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -129483,10 +129542,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -134012,6 +134070,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -134020,10 +134081,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -138531,6 +138591,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -138539,10 +138602,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -143056,6 +143118,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -143064,10 +143129,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -147571,6 +147635,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -147579,10 +147646,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -152074,6 +152140,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -152082,10 +152151,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -156714,6 +156782,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -156722,10 +156793,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -161208,6 +161278,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -161216,10 +161289,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -165845,6 +165917,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -165853,10 +165928,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -170351,6 +170425,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -170359,10 +170436,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -174865,6 +174941,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -174873,10 +174952,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -179372,6 +179450,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -179380,10 +179461,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -183879,6 +183959,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -183887,10 +183970,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -188421,6 +188503,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -188429,10 +188514,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -192928,6 +193012,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -192936,10 +193023,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -197434,6 +197520,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -197442,10 +197531,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -201955,6 +202043,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -201963,10 +202054,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -206465,6 +206555,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -206473,10 +206566,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -211049,6 +211141,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -211057,10 +211152,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -215555,6 +215649,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -215563,10 +215660,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -220061,6 +220157,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -220069,10 +220168,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -224564,6 +224662,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -224572,10 +224673,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -229073,6 +229173,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -229081,10 +229184,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -233592,6 +233694,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -233600,10 +233705,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -238095,6 +238199,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -238103,10 +238210,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -242647,6 +242753,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -242655,10 +242764,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -247185,6 +247293,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -247193,10 +247304,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -251688,6 +251798,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -251696,10 +251809,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -256216,6 +256328,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -256224,10 +256339,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -260839,6 +260953,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -260847,10 +260964,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -265341,6 +265457,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -265349,10 +265468,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -269882,6 +270000,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -269890,10 +270011,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -274411,6 +274531,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -274419,10 +274542,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -278992,6 +279114,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -279000,10 +279125,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -283495,6 +283619,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -283503,10 +283630,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -288006,6 +288132,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -288014,10 +288143,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -292507,6 +292635,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -292515,10 +292646,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -297014,6 +297144,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -297022,10 +297155,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -301521,6 +301653,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -301529,10 +301664,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -306114,6 +306248,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -306122,10 +306259,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -310621,6 +310757,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -310629,10 +310768,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -315160,6 +315298,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -315168,10 +315309,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -319671,6 +319811,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -319679,10 +319822,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -324172,6 +324314,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -324180,10 +324325,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -328679,6 +328823,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -328687,10 +328834,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -333197,6 +333343,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -333205,10 +333354,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -337729,6 +337877,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -337737,10 +337888,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -342232,6 +342382,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -342240,10 +342393,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -346738,6 +346890,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -346746,10 +346901,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -351273,6 +351427,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -351281,10 +351438,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -355776,6 +355932,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -355784,10 +355943,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -360358,6 +360516,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -360366,10 +360527,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -364868,6 +365028,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -364876,10 +365039,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -369371,6 +369533,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -369379,10 +369544,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -373874,6 +374038,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -373882,10 +374049,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -378384,6 +378550,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -378392,10 +378561,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -382891,6 +383059,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -382899,10 +383070,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -387394,6 +387564,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -387402,10 +387575,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -391972,6 +392144,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -391980,10 +392155,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -396486,6 +396660,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -396494,10 +396671,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -401001,6 +401177,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -401009,10 +401188,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -405566,6 +405744,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -405574,10 +405755,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -410090,6 +410270,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -410098,10 +410281,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -414620,6 +414802,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -414628,10 +414813,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -419144,6 +419328,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -419152,10 +419339,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -423647,6 +423833,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -423655,10 +423844,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -428178,6 +428366,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -428186,10 +428377,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -432721,6 +432911,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -432729,10 +432922,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -437218,6 +437410,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -437226,10 +437421,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -441725,6 +441919,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -441733,10 +441930,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -446228,6 +446424,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -446236,10 +446435,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -450738,6 +450936,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -450746,10 +450947,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -455452,6 +455652,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -455460,10 +455663,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -459946,6 +460148,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -459954,10 +460159,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -464540,6 +464744,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -464548,10 +464755,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -469037,6 +469243,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -469045,10 +469254,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -473534,6 +473742,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -473542,10 +473753,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -478031,6 +478241,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -478039,10 +478252,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -482628,6 +482840,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -482636,10 +482851,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -487123,6 +487337,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -487131,10 +487348,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -491618,6 +491834,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -491626,10 +491845,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -496113,6 +496331,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -496121,10 +496342,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -500610,6 +500830,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -500618,10 +500841,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -505107,6 +505329,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -505115,10 +505340,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -509604,6 +509828,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -509612,10 +509839,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -514101,6 +514327,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -514109,10 +514338,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -518598,6 +518826,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -518606,10 +518837,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -523159,6 +523389,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -523167,10 +523400,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -527656,6 +527888,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -527664,10 +527899,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -532153,6 +532387,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -532161,10 +532398,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -536650,6 +536886,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -536658,10 +536897,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -541194,6 +541432,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -541202,10 +541443,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -545927,6 +546167,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -545935,10 +546178,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -550424,6 +550666,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -550432,10 +550677,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -554921,6 +555165,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -554929,10 +555176,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -559418,6 +559664,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -559426,10 +559675,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -563915,6 +564163,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -563923,10 +564174,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -568438,6 +568688,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -568446,10 +568699,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -572935,6 +573187,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -572943,10 +573198,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -577430,6 +577684,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -577438,10 +577695,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -581948,6 +582204,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -581956,10 +582215,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -586459,6 +586717,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -586467,10 +586728,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -591089,6 +591349,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -591097,10 +591360,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -595610,6 +595872,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -595618,10 +595883,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -600125,6 +600389,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -600133,10 +600400,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -604632,6 +604898,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -604640,10 +604909,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -609139,6 +609407,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -609147,10 +609418,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -613633,6 +613903,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -613641,10 +613914,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -618142,6 +618414,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -618150,10 +618425,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -622648,6 +622922,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -622656,10 +622933,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -627169,6 +627445,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -627177,10 +627456,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -631694,6 +631972,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -631702,10 +631983,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -636198,6 +636478,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -636206,10 +636489,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -640701,6 +640983,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -640709,10 +640994,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -645204,6 +645488,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -645212,10 +645499,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", @@ -649713,6 +649999,9 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "url": { + "type": "string" + }, "id": { "type": "string" } @@ -649721,10 +650010,9 @@ "required": [ "application", "application_id", + "avatar", "channel", "channel_id", - "guild", - "guild_id", "id", "name", "source_guild", diff --git a/src/api/routes/webhooks/#webhook_id/#token/index.ts b/src/api/routes/webhooks/#webhook_id/#token/index.ts index 49c47cca..6d1449eb 100644 --- a/src/api/routes/webhooks/#webhook_id/#token/index.ts +++ b/src/api/routes/webhooks/#webhook_id/#token/index.ts @@ -20,7 +20,7 @@ const router = Router(); router.get( "/", route({ - description: "Returns a webhook object for the given id.", + description: "Returns a webhook object for the given id and token.", responses: { 200: { body: "APIWebhook", @@ -45,7 +45,12 @@ router.get( throw DiscordApiErrors.INVALID_WEBHOOK_TOKEN_PROVIDED; } - return res.json(webhook); + const instanceUrl = + Config.get().api.endpointPublic || "http://localhost:3001"; + return res.json({ + ...webhook, + url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token, + }); }, ); diff --git a/src/api/routes/webhooks/#webhook_id/index.ts b/src/api/routes/webhooks/#webhook_id/index.ts index 7d528dbf..98faaac1 100644 --- a/src/api/routes/webhooks/#webhook_id/index.ts +++ b/src/api/routes/webhooks/#webhook_id/index.ts @@ -1,5 +1,10 @@ import { route } from "@spacebar/api"; -import { Webhook } from "@spacebar/util"; +import { + Config, + DiscordApiErrors, + getPermission, + Webhook, +} from "@spacebar/util"; import { Request, Response, Router } from "express"; const router = Router(); @@ -15,18 +20,29 @@ router.get( }, }), async (req: Request, res: Response) => { - // TODO: Permission check const { webhook_id } = req.params; const webhook = await Webhook.findOneOrFail({ where: { id: webhook_id }, - relations: [ - "user", - "guild", - "source_guild", - "application" /*"source_channel"*/, - ], + relations: ["channel", "guild", "application", "user"], + }); + + if (webhook.guild_id) { + const permission = await getPermission( + req.user_id, + webhook.guild_id, + ); + + if (!permission.has("MANAGE_WEBHOOKS")) + throw DiscordApiErrors.UNKNOWN_WEBHOOK; + } else if (webhook.user_id != req.user_id) + throw DiscordApiErrors.UNKNOWN_WEBHOOK; + + const instanceUrl = + Config.get().api.endpointPublic || "http://localhost:3001"; + return res.json({ + ...webhook, + url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token, }); - return res.json(webhook); }, ); diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts index 461cddb4..f037417a 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts @@ -149,7 +149,6 @@ export async function handleMessage(opts: MessageOptions): Promise { `/avatars/${opts.webhook_id}`, dataUri as string, ); - console.log(message.avatar); message.author.avatar = message.avatar; } } else { diff --git a/src/util/entities/Webhook.ts b/src/util/entities/Webhook.ts index b7fba53a..8b1585ad 100644 --- a/src/util/entities/Webhook.ts +++ b/src/util/entities/Webhook.ts @@ -38,20 +38,20 @@ export class Webhook extends BaseClass { name: string; @Column({ nullable: true }) - avatar?: string; + avatar: string; @Column({ nullable: true }) token?: string; @Column({ nullable: true }) @RelationId((webhook: Webhook) => webhook.guild) - guild_id: string; + guild_id?: string; @JoinColumn({ name: "guild_id" }) @ManyToOne(() => Guild, { onDelete: "CASCADE", }) - guild: Guild; + guild?: Guild; @Column({ nullable: true }) @RelationId((webhook: Webhook) => webhook.channel) @@ -92,4 +92,6 @@ export class Webhook extends BaseClass { onDelete: "CASCADE", }) source_guild: Guild; + + url?: string; } From adc3474216af90df8ff54089eb6d2ad67a95b533 Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:35:10 +0200 Subject: [PATCH 7/8] Consistent relations, url property, src channel --- assets/openapi.json | 13 +- assets/schemas.json | 1584 ++++++++++++++--- .../routes/channels/#channel_id/webhooks.ts | 17 +- src/api/routes/guilds/#guild_id/webhooks.ts | 19 +- .../webhooks/#webhook_id/#token/index.ts | 10 +- src/api/routes/webhooks/#webhook_id/index.ts | 11 +- src/util/entities/Webhook.ts | 16 +- 7 files changed, 1362 insertions(+), 308 deletions(-) diff --git a/assets/openapi.json b/assets/openapi.json index 5cf31327..be317720 100644 --- a/assets/openapi.json +++ b/assets/openapi.json @@ -2582,6 +2582,12 @@ "source_guild": { "$ref": "#/components/schemas/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/components/schemas/Channel" + }, "url": { "type": "string" }, @@ -2597,9 +2603,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -8741,7 +8748,7 @@ "bearer": [] } ], - "description": "Returns a webhook object for the given id.", + "description": "Returns a webhook object for the given id. Requires the MANAGE_WEBHOOKS permission or to be the owner of the webhook.", "responses": { "200": { "description": "", diff --git a/assets/schemas.json b/assets/schemas.json index cd3a018f..aecc76a2 100644 --- a/assets/schemas.json +++ b/assets/schemas.json @@ -2697,6 +2697,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -2713,9 +2719,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -7271,6 +7278,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -7287,9 +7300,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -11790,6 +11804,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -11806,9 +11826,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -16287,6 +16308,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -16303,9 +16330,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -20806,6 +20834,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -20822,9 +20856,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -25317,6 +25352,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -25333,9 +25374,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -29858,6 +29900,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -29874,9 +29922,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -34363,6 +34412,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -34379,9 +34434,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -38871,6 +38927,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -38887,9 +38949,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -43391,6 +43454,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -43407,9 +43476,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -47914,6 +47984,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -47930,9 +48006,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -52419,6 +52496,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -52435,9 +52518,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -57026,6 +57110,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -57042,9 +57132,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -61543,6 +61634,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -61559,9 +61656,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -66060,6 +66158,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -66076,9 +66180,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -70572,6 +70677,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -70588,9 +70699,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -75120,6 +75232,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -75136,9 +75254,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -79637,6 +79756,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -79653,9 +79778,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -84145,6 +84271,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -84161,9 +84293,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -88656,6 +88789,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -88672,9 +88811,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -93176,6 +93316,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -93192,9 +93338,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -97684,6 +97831,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -97700,9 +97853,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -102192,6 +102346,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -102208,9 +102368,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -106719,6 +106880,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -106735,9 +106902,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -111230,6 +111398,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -111246,9 +111420,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -115801,6 +115976,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -115817,9 +115998,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -120331,6 +120513,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -120347,9 +120535,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -125002,6 +125191,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -125018,9 +125213,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -129531,6 +129727,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -129547,9 +129749,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -134070,6 +134273,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -134086,9 +134295,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -138591,6 +138801,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -138607,9 +138823,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -143118,6 +143335,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -143134,9 +143357,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -147635,6 +147859,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -147651,9 +147881,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -152140,6 +152371,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -152156,9 +152393,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -156782,6 +157020,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -156798,9 +157042,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -161278,6 +161523,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -161294,9 +161545,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -165917,6 +166169,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -165933,9 +166191,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -170425,6 +170684,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -170441,9 +170706,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -174941,6 +175207,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -174957,9 +175229,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -179450,6 +179723,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -179466,9 +179745,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -183959,6 +184239,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -183975,9 +184261,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -188503,6 +188790,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -188519,9 +188812,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -193012,6 +193306,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -193028,9 +193328,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -197520,6 +197821,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -197536,9 +197843,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -202043,6 +202351,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -202059,9 +202373,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -206555,6 +206870,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -206571,9 +206892,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -211141,6 +211463,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -211157,9 +211485,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -215649,6 +215978,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -215665,9 +216000,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -220157,6 +220493,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -220173,9 +220515,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -224662,6 +225005,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -224678,9 +225027,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -229173,6 +229523,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -229189,9 +229545,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -233694,6 +234051,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -233710,9 +234073,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -238199,6 +238563,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -238215,9 +238585,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -242753,6 +243124,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -242769,9 +243146,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -247293,6 +247671,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -247309,9 +247693,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -251798,6 +252183,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -251814,9 +252205,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -256328,6 +256720,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -256344,9 +256742,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -260953,6 +261352,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -260969,9 +261374,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -265457,6 +265863,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -265473,9 +265885,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -270000,6 +270413,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -270016,9 +270435,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -274531,6 +274951,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -274547,9 +274973,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -279114,6 +279541,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -279130,9 +279563,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -283619,6 +284053,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -283635,9 +284075,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -288132,6 +288573,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -288148,9 +288595,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -292635,6 +293083,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -292651,9 +293105,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -297144,6 +297599,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -297160,9 +297621,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -301653,6 +302115,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -301669,9 +302137,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -306248,6 +306717,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -306264,9 +306739,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -310757,6 +311233,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -310773,9 +311255,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -315298,6 +315781,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -315314,9 +315803,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -319811,6 +320301,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -319827,9 +320323,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -324314,6 +324811,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -324330,9 +324833,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -328823,6 +329327,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -328839,9 +329349,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -333343,6 +333854,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -333359,9 +333876,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -337877,6 +338395,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -337893,9 +338417,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -342382,6 +342907,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -342398,9 +342929,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -346890,6 +347422,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -346906,9 +347444,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -351427,6 +351966,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -351443,9 +351988,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -355932,6 +356478,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -355948,9 +356500,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -360516,6 +361069,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -360532,9 +361091,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -365028,6 +365588,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -365044,9 +365610,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -369533,6 +370100,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -369549,9 +370122,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -374038,6 +374612,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -374054,9 +374634,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -378550,6 +379131,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -378566,9 +379153,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -383059,6 +383647,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -383075,9 +383669,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -387564,6 +388159,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -387580,9 +388181,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -392144,6 +392746,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -392160,9 +392768,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -396660,6 +397269,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -396676,9 +397291,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -401177,6 +401793,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -401193,9 +401815,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -405744,6 +406367,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -405760,9 +406389,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -410270,6 +410900,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -410286,9 +410922,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -414802,6 +415439,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -414818,9 +415461,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -419328,6 +419972,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -419344,9 +419994,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -423833,6 +424484,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -423849,9 +424506,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -428366,6 +429024,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -428382,9 +429046,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -432911,6 +433576,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -432927,9 +433598,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -437410,6 +438082,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -437426,9 +438104,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -441919,6 +442598,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -441935,9 +442620,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -446424,6 +447110,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -446440,9 +447132,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -450936,6 +451629,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -450952,9 +451651,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -455652,6 +456352,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -455668,9 +456374,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -460148,6 +460855,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -460164,9 +460877,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -464744,6 +465458,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -464760,9 +465480,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -469243,6 +469964,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -469259,9 +469986,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -473742,6 +474470,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -473758,9 +474492,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -478241,6 +478976,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -478257,9 +478998,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -482840,6 +483582,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -482856,9 +483604,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -487337,6 +488086,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -487353,9 +488108,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -491834,6 +492590,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -491850,9 +492612,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -496331,6 +497094,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -496347,9 +497116,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -500830,6 +501600,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -500846,9 +501622,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -505329,6 +506106,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -505345,9 +506128,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -509828,6 +510612,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -509844,9 +510634,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -514327,6 +515118,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -514343,9 +515140,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -518826,6 +519624,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -518842,9 +519646,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -523389,6 +524194,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -523405,9 +524216,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -527888,6 +528700,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -527904,9 +528722,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -532387,6 +533206,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -532403,9 +533228,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -536886,6 +537712,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -536902,9 +537734,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -541432,6 +542265,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -541448,9 +542287,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -546167,6 +547007,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -546183,9 +547029,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -550666,6 +551513,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -550682,9 +551535,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -555165,6 +556019,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -555181,9 +556041,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -559664,6 +560525,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -559680,9 +560547,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -564163,6 +565031,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -564179,9 +565053,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -568688,6 +569563,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -568704,9 +569585,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -573187,6 +574069,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -573203,9 +574091,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -577684,6 +578573,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -577700,9 +578595,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -582204,6 +583100,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -582220,9 +583122,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -586717,6 +587620,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -586733,9 +587642,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -591349,6 +592259,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -591365,9 +592281,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -595872,6 +596789,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -595888,9 +596811,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -600389,6 +601313,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -600405,9 +601335,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -604898,6 +605829,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -604914,9 +605851,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -609407,6 +610345,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -609423,9 +610367,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -613903,6 +614848,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -613919,9 +614870,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -618414,6 +619366,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -618430,9 +619388,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -622922,6 +623881,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -622938,9 +623903,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -627445,6 +628411,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -627461,9 +628433,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -631972,6 +632945,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -631988,9 +632967,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -636478,6 +637458,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -636494,9 +637480,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -640983,6 +641970,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -640999,9 +641992,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -645488,6 +646482,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -645504,9 +646504,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] @@ -649999,6 +651000,12 @@ "source_guild": { "$ref": "#/definitions/Guild" }, + "source_channel_id": { + "type": "string" + }, + "source_channel": { + "$ref": "#/definitions/Channel" + }, "url": { "type": "string" }, @@ -650015,9 +651022,10 @@ "channel_id", "id", "name", - "source_guild", - "source_guild_id", + "source_channel", + "source_channel_id", "type", + "url", "user", "user_id" ] diff --git a/src/api/routes/channels/#channel_id/webhooks.ts b/src/api/routes/channels/#channel_id/webhooks.ts index 4c1ccbdf..7533fceb 100644 --- a/src/api/routes/channels/#channel_id/webhooks.ts +++ b/src/api/routes/channels/#channel_id/webhooks.ts @@ -1,17 +1,17 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ @@ -53,13 +53,20 @@ router.get( where: { channel_id }, relations: [ "user", + "channel", + "source_channel", "guild", "source_guild", - "application" /*"source_channel"*/, + "application", ], }); - return res.json(webhooks); + const instanceUrl = + Config.get().api.endpointPublic || "http://localhost:3001"; + return res.json(webhooks.map(webhook => ({ + ...webhook, + url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token, + }))); }, ); diff --git a/src/api/routes/guilds/#guild_id/webhooks.ts b/src/api/routes/guilds/#guild_id/webhooks.ts index a2ef7d69..60c9818a 100644 --- a/src/api/routes/guilds/#guild_id/webhooks.ts +++ b/src/api/routes/guilds/#guild_id/webhooks.ts @@ -1,23 +1,23 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ import { route } from "@spacebar/api"; -import { Webhook } from "@spacebar/util"; +import { Config, Webhook } from "@spacebar/util"; import { Request, Response, Router } from "express"; const router = Router(); @@ -39,13 +39,20 @@ router.get( where: { guild_id }, relations: [ "user", + "channel", + "source_channel", "guild", "source_guild", - "application" /*"source_channel"*/, + "application", ], }); - return res.json(webhooks); + const instanceUrl = + Config.get().api.endpointPublic || "http://localhost:3001"; + return res.json(webhooks.map(webhook => ({ + ...webhook, + url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token, + }))); }, ); diff --git a/src/api/routes/webhooks/#webhook_id/#token/index.ts b/src/api/routes/webhooks/#webhook_id/#token/index.ts index 6d1449eb..8e0ad0dd 100644 --- a/src/api/routes/webhooks/#webhook_id/#token/index.ts +++ b/src/api/routes/webhooks/#webhook_id/#token/index.ts @@ -34,7 +34,14 @@ router.get( where: { id: webhook_id, }, - relations: ["channel", "guild", "application"], + relations: [ + "user", + "channel", + "source_channel", + "guild", + "source_guild", + "application", + ], }); if (!webhook) { @@ -65,6 +72,7 @@ const messageUpload = multer({ }); // max upload 50 mb // https://discord.com/developers/docs/resources/webhook#execute-webhook +// TODO: GitHub/Slack compatible hooks router.post( "/", messageUpload.any(), diff --git a/src/api/routes/webhooks/#webhook_id/index.ts b/src/api/routes/webhooks/#webhook_id/index.ts index 98faaac1..c10bf224 100644 --- a/src/api/routes/webhooks/#webhook_id/index.ts +++ b/src/api/routes/webhooks/#webhook_id/index.ts @@ -11,7 +11,7 @@ const router = Router(); router.get( "/", route({ - description: "Returns a webhook object for the given id.", + description: "Returns a webhook object for the given id. Requires the MANAGE_WEBHOOKS permission or to be the owner of the webhook.", responses: { 200: { body: "APIWebhook", @@ -23,7 +23,14 @@ router.get( const { webhook_id } = req.params; const webhook = await Webhook.findOneOrFail({ where: { id: webhook_id }, - relations: ["channel", "guild", "application", "user"], + relations: [ + "user", + "channel", + "source_channel", + "guild", + "source_guild", + "application", + ], }); if (webhook.guild_id) { diff --git a/src/util/entities/Webhook.ts b/src/util/entities/Webhook.ts index 8b1585ad..9539d6e8 100644 --- a/src/util/entities/Webhook.ts +++ b/src/util/entities/Webhook.ts @@ -85,13 +85,23 @@ export class Webhook extends BaseClass { @Column({ nullable: true }) @RelationId((webhook: Webhook) => webhook.guild) - source_guild_id: string; + source_guild_id?: string; @JoinColumn({ name: "source_guild_id" }) @ManyToOne(() => Guild, { onDelete: "CASCADE", }) - source_guild: Guild; + source_guild?: Guild; - url?: string; + @Column({ nullable: true }) + @RelationId((webhook: Webhook) => webhook.channel) + source_channel_id: string; + + @JoinColumn({ name: "source_channel_id" }) + @ManyToOne(() => Channel, { + onDelete: "CASCADE", + }) + source_channel: Channel; + + url: string; } From 4b1e9ba851a38cd36f6c5b362b51ecf39bad6ef2 Mon Sep 17 00:00:00 2001 From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:36:00 +0200 Subject: [PATCH 8/8] Prettier --- src/api/routes/channels/#channel_id/webhooks.ts | 15 +++++++++++---- src/api/routes/guilds/#guild_id/webhooks.ts | 15 +++++++++++---- src/api/routes/webhooks/#webhook_id/index.ts | 3 ++- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/api/routes/channels/#channel_id/webhooks.ts b/src/api/routes/channels/#channel_id/webhooks.ts index 7533fceb..2060760d 100644 --- a/src/api/routes/channels/#channel_id/webhooks.ts +++ b/src/api/routes/channels/#channel_id/webhooks.ts @@ -63,10 +63,17 @@ router.get( const instanceUrl = Config.get().api.endpointPublic || "http://localhost:3001"; - return res.json(webhooks.map(webhook => ({ - ...webhook, - url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token, - }))); + return res.json( + webhooks.map((webhook) => ({ + ...webhook, + url: + instanceUrl + + "/webhooks/" + + webhook.id + + "/" + + webhook.token, + })), + ); }, ); diff --git a/src/api/routes/guilds/#guild_id/webhooks.ts b/src/api/routes/guilds/#guild_id/webhooks.ts index 60c9818a..47e19947 100644 --- a/src/api/routes/guilds/#guild_id/webhooks.ts +++ b/src/api/routes/guilds/#guild_id/webhooks.ts @@ -49,10 +49,17 @@ router.get( const instanceUrl = Config.get().api.endpointPublic || "http://localhost:3001"; - return res.json(webhooks.map(webhook => ({ - ...webhook, - url: instanceUrl + "/webhooks/" + webhook.id + "/" + webhook.token, - }))); + return res.json( + webhooks.map((webhook) => ({ + ...webhook, + url: + instanceUrl + + "/webhooks/" + + webhook.id + + "/" + + webhook.token, + })), + ); }, ); diff --git a/src/api/routes/webhooks/#webhook_id/index.ts b/src/api/routes/webhooks/#webhook_id/index.ts index c10bf224..59fdb76d 100644 --- a/src/api/routes/webhooks/#webhook_id/index.ts +++ b/src/api/routes/webhooks/#webhook_id/index.ts @@ -11,7 +11,8 @@ const router = Router(); router.get( "/", route({ - description: "Returns a webhook object for the given id. Requires the MANAGE_WEBHOOKS permission or to be the owner of the webhook.", + description: + "Returns a webhook object for the given id. Requires the MANAGE_WEBHOOKS permission or to be the owner of the webhook.", responses: { 200: { body: "APIWebhook",