fix(Message#url): Handle outside guilds (#319)

* fix(structures/message/get url): NON NULL ASSERTION? BFFR

* chore: fmt
This commit is contained in:
veryCrunchy 2025-01-04 07:45:44 +01:00 committed by GitHub
parent 250346fe1d
commit 3af070cbd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -69,7 +69,7 @@ export class BaseMessage extends DiscordBase {
}
get url() {
return Formatter.messageLink(this.guildId!, this.channelId, this.id);
return Formatter.messageLink(this.guildId ?? this.messageReference?.guildId ?? '@me', this.channelId, this.id);
}
async guild(force = false): Promise<GuildStructure<'api'> | undefined> {