mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat(ThreadChannel): add fetchStarterMessage (#6488)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
@@ -253,6 +253,17 @@ class ThreadChannel extends Channel {
|
||||
return members.get(this.ownerId) ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the message that started this thread, if any.
|
||||
* <info>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.</info>
|
||||
* @param {BaseFetchOptions} [options] Additional options for this fetch
|
||||
* @returns {Promise<Message>}
|
||||
*/
|
||||
fetchStarterMessage(options) {
|
||||
return this.channel.messages.fetch(this.id, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* The options used to edit a thread channel
|
||||
* @typedef {Object} ThreadEditData
|
||||
|
||||
1
typings/index.d.ts
vendored
1
typings/index.d.ts
vendored
@@ -1818,6 +1818,7 @@ export class ThreadChannel extends TextBasedChannel(Channel) {
|
||||
public permissionsFor(memberOrRole: GuildMember | Role): Readonly<Permissions>;
|
||||
public permissionsFor(memberOrRole: GuildMemberResolvable | RoleResolvable): Readonly<Permissions> | null;
|
||||
public fetchOwner(options?: FetchOwnerOptions): Promise<ThreadMember | null>;
|
||||
public fetchStarterMessage(options?: BaseFetchOptions): Promise<Message>;
|
||||
public setArchived(archived?: boolean, reason?: string): Promise<ThreadChannel>;
|
||||
public setAutoArchiveDuration(
|
||||
autoArchiveDuration: ThreadAutoArchiveDuration,
|
||||
|
||||
Reference in New Issue
Block a user