modified webhooks to match djs webhook send format

This commit is contained in:
root 2025-03-20 08:33:16 -07:00
parent dda930d501
commit 39af71131a
4 changed files with 75 additions and 2 deletions

View File

@ -8871,6 +8871,36 @@
"items": { "items": {
"type": "string" "type": "string"
} }
},
"enforce_nonce": {
"type": "boolean"
},
"nonce": {
"type": "string"
},
"poll": {
"$ref": "#/definitions/Poll"
},
"sticker_ids": {
"type": "string"
},
"message_reference": {
"type": "object",
"properties": {
"message_id": {
"type": "string"
},
"channel_id": {
"type": "string"
},
"guild_id": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"message_id"
]
} }
} }
}, },

View File

@ -698436,6 +698436,36 @@
"items": { "items": {
"type": "string" "type": "string"
} }
},
"enforce_nonce": {
"type": "boolean"
},
"nonce": {
"type": "string"
},
"poll": {
"$ref": "#/definitions/Poll"
},
"sticker_ids": {
"type": "string"
},
"message_reference": {
"type": "object",
"properties": {
"message_id": {
"type": "string"
},
"channel_id": {
"type": "string"
},
"guild_id": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"message_id"
]
} }
}, },
"additionalProperties": false, "additionalProperties": false,

View File

@ -69,7 +69,7 @@ export interface MessageCreateSchema {
} }
// TypeScript complains once this is used above // TypeScript complains once this is used above
interface PollCreationSchema { export interface PollCreationSchema {
question: PollMedia; question: PollMedia;
answers: PollAnswer[]; answers: PollAnswer[];
duration?: number; duration?: number;

View File

@ -17,7 +17,10 @@
*/ */
import { Embed } from "../entities"; import { Embed } from "../entities";
import { MessageCreateAttachment } from "./MessageCreateSchema"; import {
MessageCreateAttachment,
PollCreationSchema,
} from "./MessageCreateSchema";
export interface WebhookExecuteSchema { export interface WebhookExecuteSchema {
content?: string; content?: string;
@ -43,4 +46,14 @@ export interface WebhookExecuteSchema {
flags?: number; flags?: number;
thread_name?: string; thread_name?: string;
applied_tags?: string[]; applied_tags?: string[];
message_reference?: {
message_id: string;
channel_id?: string;
guild_id?: string;
fail_if_not_exists?: boolean;
};
sticker_ids?: string[];
nonce?: string;
enforce_nonce?: boolean; // For Discord compatibility, it's the default behavior here
poll?: PollCreationSchema;
} }