fix: logicals symbols errors

This commit is contained in:
socram03 2022-07-31 17:37:07 -04:00
parent 35a068cc96
commit 8fedad76a6
4 changed files with 4 additions and 4 deletions

View File

@ -67,7 +67,7 @@ export class Application implements Model {
this.session = session; this.session = session;
this.name = data.name; this.name = data.name;
this.icon = data.icon || undefined; this.icon = data.icon ?? undefined;
this.description = data.description; this.description = data.description;
this.rpcOrigins = data.rpc_origins; this.rpcOrigins = data.rpc_origins;
this.botPublic = data.bot_public; this.botPublic = data.bot_public;

View File

@ -161,7 +161,7 @@ export class SelectMenu extends BaseComponent implements SelectMenuComponent {
return <SelectMenuOption>{ return <SelectMenuOption>{
label: option.label, label: option.label,
description: option.description, description: option.description,
emoji: option.emoji || new Emoji(session, option.emoji!), emoji: option.emoji ? new Emoji(session, option.emoji) : undefined,
value: option.value, value: option.value,
}; };
}); });

View File

@ -70,7 +70,7 @@ export function NewMessageReactionAdd(
? new Member( ? new Member(
session, session,
data.member as DiscordMemberWithUser, data.member as DiscordMemberWithUser,
data.guild_id || '' data.guild_id ?? ''
) )
: undefined, : undefined,
emoji: new Emoji(session, data.emoji), emoji: new Emoji(session, data.emoji),

View File

@ -74,7 +74,7 @@ export type ImageSize = 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096;
*/ */
export abstract class Util { export abstract class Util {
static formatImageURL(url: string, size: ImageSize = 128, format?: ImageFormat): string { static formatImageURL(url: string, size: ImageSize = 128, format?: ImageFormat): string {
return `${url}.${format || (url.includes('/a_') ? 'gif' : 'jpg')}?size=${size}`; return `${url}.${format ?? (url.includes('/a_') ? 'gif' : 'jpg')}?size=${size}`;
} }
static iconHashToBigInt(hash: string): bigint { static iconHashToBigInt(hash: string): bigint {