Skip to content

Commit

Permalink
Fix emojis in more places
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianVennen committed Jul 8, 2024
1 parent bf4453e commit c5f22a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/commands/bot/InfoCommand.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import Command from '../Command.js';
import {
ActionRowBuilder,
ButtonBuilder,
ButtonStyle, hyperlink,
PermissionFlagsBits,
PermissionsBitField
} from 'discord.js';
import bot from '../../bot/Bot.js';
import config from '../../bot/Config.js';
import KeyValueEmbed from '../../embeds/KeyValueEmbed.js';
import {formatTime} from '../../util/timeutils.js';
import {readFile} from 'fs/promises';
import {exec} from 'child_process';
import {promisify} from 'util';
import {componentEmojiIfExists} from '../../util/format.js';
import BetterButtonBuilder from '../../embeds/BetterButtonBuilder.js';

export const DISCORD_INVITE_LINK = 'https://discord.gg/zYYhgPtmxw';
export const GITHUB_REPOSITORY = 'https://github.com/aternosorg/modbot';
Expand Down Expand Up @@ -97,11 +97,11 @@ export default class InfoCommand extends Command {
new ActionRowBuilder()
.addComponents(
/** @type {*} */ buttons.map(data =>
new ButtonBuilder()
new BetterButtonBuilder()
.setLabel(data.name)
.setStyle(ButtonStyle.Link)
.setURL(data.url)
.setEmoji(config.data.emoji[data.emoji] ?? {}))
.setEmojiIfPresent(componentEmojiIfExists(data.emoji, null)))
)
]
});
Expand Down
11 changes: 6 additions & 5 deletions src/commands/settings/SettingsOverviewCommand.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import SubCommand from '../SubCommand.js';
import GuildSettings from '../../settings/GuildSettings.js';
import {ActionRowBuilder, ButtonBuilder, ButtonStyle} from 'discord.js';
import {ActionRowBuilder, ButtonStyle} from 'discord.js';
import {componentEmojiIfExists} from '../../util/format.js';
import icons from '../../util/icons.js';
import BetterButtonBuilder from '../../embeds/BetterButtonBuilder.js';

export default class SettingsOverviewCommand extends SubCommand {

Expand All @@ -17,7 +18,7 @@ export default class SettingsOverviewCommand extends SubCommand {
/**
*
* @param {import('discord.js').Interaction} interaction
* @return {Promise<{components: ActionRowBuilder<ButtonBuilder>[], ephemeral: boolean, embeds: EmbedBuilder[]}>}
* @return {Promise<{components: ActionRowBuilder<ButtonBuilder>[], ephemeral: boolean, embeds: import('discord.js').EmbedBuilder[]}>}
*/
async buildMessage(interaction) {
const guildSettings = await GuildSettings.get(interaction.guildId);
Expand All @@ -28,15 +29,15 @@ export default class SettingsOverviewCommand extends SubCommand {
.setAuthor({name: `${interaction.guild.name}| Settings`, iconURL: interaction.guild.iconURL()})
],
components: [
/** @type {ActionRowBuilder<ButtonBuilder>}*/
/** @type {ActionRowBuilder<import('discord.js').ButtonBuilder>}*/
new ActionRowBuilder()
.addComponents(
/** @type {*} */
new ButtonBuilder()
new BetterButtonBuilder()
.setLabel('Refresh')
.setStyle(ButtonStyle.Secondary)
.setCustomId('settings:overview')
.setEmoji(componentEmojiIfExists('refresh', icons.refresh))
.setEmojiIfPresent(componentEmojiIfExists('refresh', icons.refresh))
)
]
};
Expand Down

0 comments on commit c5f22a3

Please sign in to comment.