diff --git a/packages/discord.js/src/structures/ThreadChannel.js b/packages/discord.js/src/structures/ThreadChannel.js index fe757c62d715..14cbe6b84dd9 100644 --- a/packages/discord.js/src/structures/ThreadChannel.js +++ b/packages/discord.js/src/structures/ThreadChannel.js @@ -283,10 +283,11 @@ class ThreadChannel extends BaseChannel { * This only works when the thread started from a message in the parent channel, otherwise the promise will * reject. If you just need the id of that message, use {@link ThreadChannel#id} instead. * @param {BaseFetchOptions} [options] Additional options for this fetch - * @returns {Promise} + * @returns {Promise} */ - fetchStarterMessage(options) { - return this.parent.messages.fetch({ message: this.id, ...options }); + // eslint-disable-next-line require-await + async fetchStarterMessage(options) { + return this.parent?.messages.fetch({ message: this.id, ...options }) ?? null; } /** diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 84550ceae20f..f86f7c5182ee 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -2540,7 +2540,7 @@ export class ThreadChannel extends TextBasedChannelMixin(BaseChannel, ['fetchWeb checkAdmin?: boolean, ): Readonly | null; public fetchOwner(options?: BaseFetchOptions): Promise; - public fetchStarterMessage(options?: BaseFetchOptions): Promise; + public fetchStarterMessage(options?: BaseFetchOptions): Promise; public setArchived(archived?: boolean, reason?: string): Promise; public setAutoArchiveDuration( autoArchiveDuration: ThreadAutoArchiveDuration,