Skip to content

Commit

Permalink
fix(discordcommand): fixed boolean types and add ifDefined
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Nov 2, 2024
1 parent 5a47bb0 commit 4352655
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions packages/core/src/components/discord-command/DiscordCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ export class DiscordCommand extends LitElement implements LightTheme {
* Whether the referenced context message is from a response of a slash command.
*/
@property({ type: Boolean, attribute: 'context-command-reply' })
public accessor contextCommandReply: Boolean = false;
public accessor contextCommandReply: boolean = false;

/**
* Whether the referenced context message contains attachments.
*/
@property({ type: Boolean, attribute: 'context-attachment-reply' })
public accessor contextAttachmentReply: Boolean = false;
public accessor contextAttachmentReply: boolean = false;

/**
* The referenced message in message command
Expand All @@ -190,19 +190,19 @@ export class DiscordCommand extends LitElement implements LightTheme {
* If the referenced messaga has deleted
*/
@property({ type: Boolean, attribute: 'context-message-deleted' })
public accessor contextMessageDeleted: Boolean = false;
public accessor contextMessageDeleted: boolean = false;

/**
* If the context user is a application official of discord
*/
@property({ type: Boolean, attribute: 'context-user-application-official' })
public accessor contextUserOfficialApplication: Boolean = false;
public accessor contextUserOfficialApplication: boolean = false;

/**
* If the context user is a server
*/
@property({ type: Boolean, attribute: 'context-user-server' })
public accessor contextUserServer: Boolean = false;
public accessor contextUserServer: boolean = false;

/**
* Whether to use compact mode or not.
Expand Down Expand Up @@ -308,7 +308,12 @@ export class DiscordCommand extends LitElement implements LightTheme {
src="${ifDefined(profileContext.avatar)}"
alt="${ifDefined(profileContext.author)}"
/>`,
() => html`<img class="discord-replied-message-avatar" src="${avatars.blue}" alt="OFFICIALAPPLICATION" />`
() =>
html`<img
class="discord-replied-message-avatar"
src="${ifDefined(avatars.blue)}"
alt="OFFICIALAPPLICATION"
/>`
)
)}
${when(
Expand All @@ -327,7 +332,7 @@ export class DiscordCommand extends LitElement implements LightTheme {
)}
<span class="discord-replied-message-username" style=${styleMap({ color: profileContext.roleColor ?? '' })}
>${profileContext.author}</span
><span> </span>
><span></span>
</div>`,
() =>
when(this.contextMessageDeleted, () =>
Expand Down

0 comments on commit 4352655

Please sign in to comment.