feat(ui): complete UI embed

This commit is contained in:
NoLogicAlan committed 2026-10-26 02:36:56 +03:00
1 parent e8171dce26
commit edcdd4ddef
15 files changed
+252 -52

No files matched your search

+4 -4
View File
@@ -460,10 +460,10 @@ export async function run(msg) {
activeKeys = previousActiveKeys;
const errEmbed = new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: `🎛️ ${this.t(msg, "responses.filter.pickerTitle")}` })
.setDescription(
this.t(msg, "responses.filter.applyFailed", { filter: filter.label, reason })
)
;
);
await menuMsg.edit({ embeds: [errEmbed] }).catch(() => {});
await Utils.sleep(1500);
await menuMsg.edit({
@@ -488,12 +488,12 @@ export async function run(msg) {
const confirmEmbed = new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: `🎛️ ${this.t(msg, "responses.filter.pickerTitle")}` })
.setDescription(
`${successMsg}\n\n` +
`*${filter.desc}*\n\n` +
`💡 ${this.t(msg, "responses.filter.reactToToggle")}`
)
;
);
await menuMsg.edit({ embeds: [confirmEmbed] }).catch(() => {});
await Utils.sleep(1200);
+28 -6
View File
@@ -45,7 +45,9 @@ export async function runAccountActions(msg, data, lastfm, prefix, userId, targe
return msg.reply({
embeds: [new EmbedBuilder()
.setColor(getGlobalColor())
.setDescription(this.t(msg, "responses.lastfm.alreadyLinked", { username: existing.username, prefix }))]
.setAuthor({ name: this.t(msg, "responses.lastfm.accountAuthor") })
.setDescription(this.t(msg, "responses.lastfm.alreadyLinked", { username: existing.username, prefix }))
.setFooter({ text: this.t(msg, "responses.lastfm.accountFooter", { prefix }) })]
});
}
@@ -75,11 +77,14 @@ export async function runAccountActions(msg, data, lastfm, prefix, userId, targe
const replyEmbed = new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: this.t(msg, "responses.lastfm.accountAuthor") })
.setTitle(this.t(msg, "responses.lastfm.authLinkTitle"))
.setDescription(
sent
? this.t(msg, "responses.lastfm.authDM", { prefix })
: this.t(msg, "responses.lastfm.authDMFailed", { url: authUrl, prefix })
);
)
.setFooter({ text: this.t(msg, "responses.lastfm.accountFooter", { prefix }) });
return msg.reply({ embeds: [replyEmbed] });
}
@@ -113,7 +118,10 @@ export async function runAccountActions(msg, data, lastfm, prefix, userId, targe
return msg.reply({
embeds: [new EmbedBuilder()
.setColor(getGlobalColor())
.setDescription(this.t(msg, "responses.lastfm.linked", { username: session.name }))]
.setAuthor({ name: this.t(msg, "responses.lastfm.accountAuthor") })
.setTitle(this.t(msg, "responses.lastfm.accountLinkedTitle"))
.setDescription(this.t(msg, "responses.lastfm.linked", { username: session.name }))
.setFooter({ text: this.t(msg, "responses.lastfm.accountFooter", { prefix }) })]
});
}
@@ -123,7 +131,12 @@ export async function runAccountActions(msg, data, lastfm, prefix, userId, targe
await lastfm.removeUser(userId);
return msg.reply({
embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(this.t(msg, "responses.lastfm.unlinked", { username: user.username }))]
embeds: [new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: this.t(msg, "responses.lastfm.accountAuthor") })
.setTitle(this.t(msg, "responses.lastfm.accountUnlinkedTitle"))
.setDescription(this.t(msg, "responses.lastfm.unlinked", { username: user.username }))
.setFooter({ text: this.t(msg, "responses.lastfm.accountFooter", { prefix }) })]
});
}
@@ -137,10 +150,13 @@ export async function runAccountActions(msg, data, lastfm, prefix, userId, targe
return msg.reply({
embeds: [new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: this.t(msg, "responses.lastfm.accountAuthor") })
.setTitle(this.t(msg, "responses.lastfm.scrobbleTitle"))
.setDescription(newState
? this.t(msg, "responses.lastfm.scrobbleEnabled", { username: user.username })
: this.t(msg, "responses.lastfm.scrobbleDisabled")
)]
)
.setFooter({ text: this.t(msg, "responses.lastfm.accountFooter", { prefix }) })]
});
}
@@ -246,7 +262,12 @@ export async function runAccountActions(msg, data, lastfm, prefix, userId, targe
if (!playlists.length) {
return msg.reply({
embeds: [new EmbedBuilder().setColor(getGlobalColor()).setDescription(this.t(msg, "responses.lastfm.noPlaylists", { username: user.username }))]
embeds: [new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: this.t(msg, "responses.lastfm.playlistsAuthor") })
.setTitle(this.t(msg, "responses.lastfm.playlistsTitle", { username: user.username }))
.setDescription(this.t(msg, "responses.lastfm.noPlaylists", { username: user.username }))
.setFooter({ text: this.t(msg, "responses.lastfm.playlistsFooter", { prefix }) })]
});
}
@@ -261,6 +282,7 @@ export async function runAccountActions(msg, data, lastfm, prefix, userId, targe
return msg.reply({
embeds: [new EmbedBuilder()
.setColor(getGlobalColor())
.setAuthor({ name: this.t(msg, "responses.lastfm.playlistsAuthor") })
.setTitle(this.t(msg, "responses.lastfm.playlistsTitle", { username: user.username }))
.setDescription(desc)
.setFooter({ text: this.t(msg, "responses.lastfm.playlistsFooter", { prefix }) })]
+9 -1
View File
@@ -143,7 +143,12 @@ export async function run(message, data) {
} else {
current = p?.queue?.getCurrent() ?? null;
if (!current) {
const embed = new EmbedBuilder().setColor(0xe9196c).setDescription(this.t(message, "responses.lyrics.nothingPlaying"));
const prefix = this.handler.getPrefix(message.message?.guildId ?? message.channel?.guildId) || "%";
const embed = new EmbedBuilder()
.setColor(0xe9196c)
.setAuthor({ name: this.t(message, "responses.lyrics.lyricsAuthor") })
.setDescription(this.t(message, "responses.lyrics.nothingPlaying"))
.setFooter({ text: this.t(message, "responses.lyrics.manualSearchFooter", { prefix }) });
return message.reply({ embeds: [embed] });
}
searchTitle = current.title;
@@ -175,11 +180,14 @@ export async function run(message, data) {
clearInterval(loadingInterval);
if (!result || !result.text) {
const prefix = this.handler.getPrefix(message.message?.guildId ?? message.channel?.guildId) || "%";
return loadingMsg.edit({ embeds: [
new EmbedBuilder().setColor(0xe9196c)
.setAuthor({ name: this.t(message, "responses.lyrics.lyricsAuthor") })
.setDescription(
this.t(message, "responses.lyrics.noLyrics", { title: Utils.truncate(searchTitle, 40) })
)
.setFooter({ text: this.t(message, "responses.lyrics.artistSearchFooter", { prefix }) })
] });
}
+2 -2
View File
@@ -135,7 +135,7 @@ function build247PanelDescription(set, ctx, guildId, justToggledId = null) {
.sort((a, b) => a.order - b.order);
const lines = statuses.map(s =>
s.line + (justToggledId && s.line.includes("<#" + cleanId(justToggledId) + ">") ? " \u2190" : "")
s.line + (justToggledId && s.line.includes("<#" + cleanId(justToggledId) + ">") ? " ←" : "")
);
const allConnected = statuses.every(s => s.state === "connected");
@@ -187,7 +187,7 @@ export function build247Panel(set, ctx, guildId, justToggledId = null) {
.sort((a, b) => a.order - b.order);
const lines = statuses.map(s =>
s.line + (justToggledId && s.line.includes("<#" + cleanId(justToggledId) + ">") ? " \u2190" : "")
s.line + (justToggledId && s.line.includes("<#" + cleanId(justToggledId) + ">") ? " ←" : "")
);
const allConnected = statuses.every(s => s.state === "connected");
+1 -1
View File
@@ -82,7 +82,7 @@ export async function applySet(ctx, message, set, key, rawValue) {
if (runnables[key]) {
const err = runnables[key].call(ctx, rawValue, { msg: message });
if (err) return "\u274c " + err;
if (err) return "❌ " + err;
}
set.set(key, rawValue);
+1 -1
View File
@@ -83,7 +83,7 @@ export function parseBool(str) {
* @returns {string} Formatted display string.
*/
export function displayValue(key, value) {
if (BOOL_SETTINGS.has(key)) return value ? "\u2705 enabled" : "\u274c disabled";
if (BOOL_SETTINGS.has(key)) return value ? "✅ enabled" : "❌ disabled";
if (value === null || value === undefined || value === "none") return "none";
return "`" + value + "`";
}
+12 -3
View File
@@ -51,7 +51,10 @@ function notConfigured(t, guildId) {
return {
embeds: [new EmbedBuilder()
.setColor(ERROR_COLOR)
.setDescription(t(guildId, "responses.vote.notConfigured"))]
.setAuthor({ name: t(guildId, "responses.vote.voteAuthor") })
.setTitle(t(guildId, "responses.vote.notConfiguredTitle"))
.setDescription(t(guildId, "responses.vote.notConfigured"))
.setFooter({ text: t(guildId, "responses.vote.voteFooterHint", { prefix: "%" }) })]
};
}
@@ -68,7 +71,10 @@ function noResourceId(type, prefix, t, guildId) {
return {
embeds: [new EmbedBuilder()
.setColor(ERROR_COLOR)
.setDescription(t(guildId, "responses.vote.noResourceId", { type, prefix }))]
.setAuthor({ name: t(guildId, "responses.vote.voteAuthor") })
.setTitle(t(guildId, "responses.vote.noResourceIdTitle"))
.setDescription(t(guildId, "responses.vote.noResourceId", { type, prefix }))
.setFooter({ text: t(guildId, "responses.vote.voteFooterHint", { prefix }) })]
};
}
@@ -236,7 +242,10 @@ export async function run(msg, data) {
return msg.reply({
embeds: [new EmbedBuilder()
.setColor(getGlobalColor())
.setDescription(this.t(msg, "responses.vote.noVotersYet", { type: resolvedType }))]
.setAuthor({ name: this.t(msg, "responses.vote.voteVotersAuthor") })
.setTitle(this.t(msg, "responses.vote.noVotersTitle"))
.setDescription(this.t(msg, "responses.vote.noVotersYet", { type: resolvedType }))
.setFooter({ text: this.t(msg, "responses.vote.voteFooterHint", { prefix }) })]
});
}