feat: more readable time delta #193

Merged
Anri merged 6 commits from date into dev 2024-10-08 20:53:29 +02:00
3 changed files with 9 additions and 3 deletions
Showing only changes of commit 56762aaa05 - Show all commits

View file

@ -131,3 +131,8 @@ export const emojiPng = (emoji: string) =>
`https://cdn.jsdelivr.net/gh/twitter/twemoji/assets/72x72/${emoji
.codePointAt(0)
?.toString(16)}.png`;
/**
* Blank character
*/
export const blank = "\u200b";

View file

@ -2,6 +2,7 @@ import { EmbedBuilder } from "@discordjs/builders";
import { GuildQueue, QueueRepeatMode } from "discord-player";
import { Client } from "discord.js";
import { getLocale } from "./locales";
import { blank } from "./misc";
export const embedListQueue = (
client: Client,
@ -30,7 +31,7 @@ export const embedListQueue = (
? loc.get("c_queue10")
: (idx === 1 && page === 1) || (idx === 0 && page > 1)
? loc.get("c_queue11")
: "\u200b";
: blank;
const idx_track = now_playing ? "" : `${idx + limit_fields * (page - 1)}. `;
embed.addFields({
name,

View file

@ -1,6 +1,6 @@
import { Client, Colors, EmbedBuilder, User } from "discord.js";
import { getLocale } from "./locales";
import { cleanCodeBlock } from "./misc";
import { blank, cleanCodeBlock } from "./misc";
import { showDate, strToSeconds, timeDeltaToString } from "./time";
import { RegexC, RegExpFlags } from "./regex";
@ -442,7 +442,7 @@ export const embedListReminders = async (
});
} else {
embed.addFields({
name: "\u200b",
name: blank,
value: `${loc.get("c_reminder10")}${page} ${loc.get("c_reminder11")}.`,
});
}