Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 13x 9x 9x 9x 3x 6x 2x 4x 2x | const plural = (count, unit) => `${count} ${unit}${count === 1 ? "" : "s"}`;
export function formatCooldownRemaining(totalSeconds) {
const minutes = Math.floor(totalSeconds / 60);
const seconds = totalSeconds % 60;
if (minutes === 0) {
return plural(seconds, "second");
}
if (seconds === 0) {
return plural(minutes, "minute");
}
return `${plural(minutes, "minute")} ${plural(seconds, "second")}`;
}
export function cooldownErrorMessage(totalSeconds) {
return `You are on a chat cooldown. You can send messages again in ${formatCooldownRemaining(totalSeconds)}.`;
}
|