From 7b161f93a040a6bdce6e7e26d7a3c3b6c61a04fd Mon Sep 17 00:00:00 2001 From: monbrey Date: Thu, 15 Apr 2021 08:38:45 +1000 Subject: [PATCH] feat(MessageAttachment): support for #contentType (#5481) Co-authored-by: Jan <66554238+vaporox@users.noreply.github.com> --- src/structures/MessageAttachment.js | 6 ++++++ typings/index.d.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/src/structures/MessageAttachment.js b/src/structures/MessageAttachment.js index f5fb723b2..6041e9e76 100644 --- a/src/structures/MessageAttachment.js +++ b/src/structures/MessageAttachment.js @@ -79,6 +79,12 @@ class MessageAttachment { * @type {?number} */ this.width = typeof data.width !== 'undefined' ? data.width : null; + + /** + * This media type of this attachment + * @type {?string} + */ + this.contentType = data.content_type ?? null; } /** diff --git a/typings/index.d.ts b/typings/index.d.ts index 121127bb5..cfec2e7ae 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1061,6 +1061,7 @@ declare module 'discord.js' { constructor(attachment: BufferResolvable | Stream, name?: string, data?: object); public attachment: BufferResolvable | Stream; + public contentType: string | null; public height: number | null; public id: Snowflake; public name: string | null;