diff --git a/packages/discord.js/src/structures/Channel.js b/packages/discord.js/src/structures/Channel.js index e460e9821..b5d85be8a 100644 --- a/packages/discord.js/src/structures/Channel.js +++ b/packages/discord.js/src/structures/Channel.js @@ -57,6 +57,15 @@ class Channel extends Base { return new Date(this.createdTimestamp); } + /** + * The URL to the channel + * @type {string} + * @readonly + */ + get url() { + return `https://discord.com/channels/${this.isDMBased() ? '@me' : this.guildId}/${this.id}`; + } + /** * Whether this Channel is a partial * This is always false outside of DM channels. diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index d5bec6404..c83568496 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -494,6 +494,7 @@ export abstract class Channel extends Base { public id: Snowflake; public readonly partial: false; public type: ChannelType; + public readonly url: string; public delete(): Promise; public fetch(force?: boolean): Promise; public isText(): this is TextChannel;