feat: Added missing url getters (#112)

This commit is contained in:
Free 公園 2022-09-14 15:01:07 -06:00 committed by GitHub
parent c916e9cb94
commit dde0bffc57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -676,6 +676,11 @@ export class GuildChannel extends BaseChannel implements Model {
async setPermissions(overwrites: PermissionsOverwrites[]): Promise<Channel> {
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 */

View File

@ -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

View File

@ -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,