diff --git a/src/structures/ThreadChannel.js b/src/structures/ThreadChannel.js index b098c15322de..9fceaa6d58cf 100644 --- a/src/structures/ThreadChannel.js +++ b/src/structures/ThreadChannel.js @@ -253,6 +253,17 @@ class ThreadChannel extends Channel { return members.get(this.ownerId) ?? null; } + /** + * Fetches the message that started this thread, if any. + * This in only available when the thread started from a message in the parent channel. + * If you just need the id of that message, use {@link ThreadChannel#id this channel's id} instead. + * @param {BaseFetchOptions} [options] Additional options for this fetch + * @returns {Promise} + */ + fetchStarterMessage(options) { + return this.channel.messages.fetch(this.id, options); + } + /** * The options used to edit a thread channel * @typedef {Object} ThreadEditData diff --git a/typings/index.d.ts b/typings/index.d.ts index 063f229bfa6f..f96b08a19424 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1812,6 +1812,7 @@ export class ThreadChannel extends TextBasedChannel(Channel) { public permissionsFor(memberOrRole: GuildMember | Role): Readonly; public permissionsFor(memberOrRole: GuildMemberResolvable | RoleResolvable): Readonly | null; public fetchOwner(options?: FetchOwnerOptions): Promise; + public fetchStarterMessage(options?: BaseFetchOptions): Promise; public setArchived(archived?: boolean, reason?: string): Promise; public setAutoArchiveDuration( autoArchiveDuration: ThreadAutoArchiveDuration,