Add seek validation, autoplay system, progress bar & codebase cleanup

- Add seek duration validation — seeks beyond track length are rejected
  with clear error showing max allowed position
- Add autoplay system with Last.fm similar tracks + YouTube search
  fallback — automatically queues similar tracks when queue ends
- Add live progress bar to now playing with elapsed/total time display
- Add robust ffmpeg cleanup to prevent race conditions during
  seek/skip/filter operations
- Add proper queue advancement after seek so bot stays in voice
- Add queueEnd event emission on skip/skipTo for autoplay trigger
- Add _lastPlayedTrack preservation for autoplay recommendations
This commit is contained in:
NoLogicAlan committed 2026-05-21 02:04:05 +03:00
1 parent bc1fe82919
commit 0f2ee99f1e
23 files changed
+665 -170

No files matched your search

-7
View File
@@ -29,7 +29,6 @@ function richEmbed(fields, opts = {}) {
return { embeds: [raw] };
}
const SHORTCUTS = {
prefix: "prefix",
pfx: "prefix",
@@ -51,7 +50,6 @@ const VOLUME_MIN = 1;
const VOLUME_MAX = 200;
const MAX_247_CHANNELS = 10;
/** Extract clean numeric channel ID from any format */
function cleanId(raw) {
return String(raw).replace(/\D/g, "");
@@ -99,7 +97,6 @@ function getGuildName(message) {
return message.message?.guild?.name ?? message.channel?.guild?.name ?? "this server";
}
/**
* Get the 24/7 mode for a specific channel.
* Reads from the per-channel map (stay_247_modes) first,
@@ -521,7 +518,6 @@ async function handle247(ctx, message, value) {
}
}
/**
* Validate and save a setting value.
* @returns {string|null} Error message string, or null on success.
@@ -582,7 +578,6 @@ async function applySet(ctx, message, set, key, rawValue) {
return null;
}
async function handleShortcut(ctx, message, settingKey, valueTokens) {
const set = ctx.getSettings(message);
@@ -605,7 +600,6 @@ async function handleShortcut(ctx, message, settingKey, valueTokens) {
}
}
export const command = function() {
if (this.locale) {
VALID_LOCALES = this.locale.availableLocales();
@@ -702,7 +696,6 @@ export const command = function() {
);
};
export async function run(message, data) {
const set = this.getSettings(message);
const cmd = data.commandId || "getSettings";