This commit is contained in:
Yuzu 2022-06-27 22:49:26 -05:00
parent 68f89bb589
commit 1124d56603
3 changed files with 13 additions and 12 deletions

View File

@ -31,22 +31,22 @@ export class AnonymousGuild extends BaseGuild implements Model {
description?: string; description?: string;
premiumSubscriptionCount?: number; premiumSubscriptionCount?: number;
splashUrl(options: { size?: ImageSize, format?: ImageFormat } = { size: 128 }) { splashUrl(options: { size?: ImageSize; format?: ImageFormat } = { size: 128 }) {
if (this.splashHash) { if (this.splashHash) {
return formatImageUrl( return formatImageUrl(
Routes.GUILD_SPLASH(this.id, iconBigintToHash(this.splashHash)), Routes.GUILD_SPLASH(this.id, iconBigintToHash(this.splashHash)),
options.size, options.size,
options.format options.format,
); );
} }
} }
bannerUrl(options: { size?: ImageSize, format?: ImageFormat } = { size: 128 }) { bannerUrl(options: { size?: ImageSize; format?: ImageFormat } = { size: 128 }) {
if (this.bannerHash) { if (this.bannerHash) {
return formatImageUrl( return formatImageUrl(
Routes.GUILD_BANNER(this.id, iconBigintToHash(this.bannerHash)), Routes.GUILD_BANNER(this.id, iconBigintToHash(this.bannerHash)),
options.size, options.size,
options.format options.format,
); );
} }
} }

View File

@ -140,13 +140,12 @@ export class Guild extends BaseGuild implements Model {
// TODO: edit role // TODO: edit role
async deleteInvite(inviteCode: string): Promise<void> { async deleteInvite(inviteCode: string): Promise<void> {
await this.session.rest.runMethod<undefined>( await this.session.rest.runMethod<undefined>(
this.session.rest, this.session.rest,
"DELETE", "DELETE",
Routes.INVITE(inviteCode), Routes.INVITE(inviteCode),
{} {},
); );
} }

View File

@ -160,12 +160,14 @@ export class Message implements Model {
users: options.allowedMentions?.users, users: options.allowedMentions?.users,
replied_user: options.allowedMentions?.repliedUser, replied_user: options.allowedMentions?.repliedUser,
}, },
message_reference: options.messageReference ? { message_reference: options.messageReference
message_id: options.messageReference.messageId, ? {
channel_id: options.messageReference.channelId, message_id: options.messageReference.messageId,
guild_id: options.messageReference.guildId, channel_id: options.messageReference.channelId,
fail_if_not_exists: options.messageReference.failIfNotExists ?? true, guild_id: options.messageReference.guildId,
} : undefined, fail_if_not_exists: options.messageReference.failIfNotExists ?? true,
}
: undefined,
}, },
); );