From dde0bffc579f3b124174b6d67cf8ffcc3fdb8dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Free=20=E5=85=AC=E5=9C=92?= <45021001+FreeAoi@users.noreply.github.com> Date: Wed, 14 Sep 2022 15:01:07 -0600 Subject: [PATCH] feat: Added missing url getters (#112) --- packages/core/src/structures/channels.ts | 5 +++++ packages/core/src/structures/guilds.ts | 5 +++++ packages/core/src/structures/message.ts | 3 +-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/core/src/structures/channels.ts b/packages/core/src/structures/channels.ts index 68c34ef..2cd50d5 100644 --- a/packages/core/src/structures/channels.ts +++ b/packages/core/src/structures/channels.ts @@ -676,6 +676,11 @@ export class GuildChannel extends BaseChannel implements Model { async setPermissions(overwrites: PermissionsOverwrites[]): Promise { return this.edit({ permissionOverwrites: overwrites } as EditGuildChannelOptions); } + + /** gets the url of the channel that points to the channel */ + get url(): string { + return `https://discord.com/channels/${this.guildId}/${this.id}`; + } } /** BaseVoiceChannel */ diff --git a/packages/core/src/structures/guilds.ts b/packages/core/src/structures/guilds.ts index 9c4375a..df232b5 100644 --- a/packages/core/src/structures/guilds.ts +++ b/packages/core/src/structures/guilds.ts @@ -133,6 +133,11 @@ export abstract class BaseGuild implements Model { return this.features.includes(GuildFeatures.Partnered); } + /** gets the url of the guild that points to the guild */ + get url(): string { + return `https://discord.com/channels/${this.id}`; + } + /** * If the guild is verified. * @link https://discord.com/developers/docs/resources/guild#guild-object-guild-features diff --git a/packages/core/src/structures/message.ts b/packages/core/src/structures/message.ts index ff49800..f226116 100644 --- a/packages/core/src/structures/message.ts +++ b/packages/core/src/structures/message.ts @@ -16,7 +16,7 @@ import type { Component } from './components'; import type { MessageInteraction } from './interactions'; import type { StickerItem } from './sticker'; import type { Embed } from './embed'; -import { NewEmbed } from './embed'; +import { NewEmbed, NewEmbedR } from './embed'; import { MessageFlags } from '../utils/util'; import { Snowflake } from '../snowflakes'; import { ChannelFactory, ThreadChannel } from './channels'; @@ -27,7 +27,6 @@ import { ComponentFactory } from './components'; import { MessageReaction } from './message-reaction'; import { Application, NewTeam } from './application'; import { InteractionFactory } from './interactions'; -import { NewEmbedR } from './embed'; import { CHANNEL_PIN,