fix long title error

This commit is contained in:
frostice482 2025-01-04 03:45:10 +07:00
parent 2f0c2c387c
commit c014979abd

View File

@ -64,13 +64,13 @@ module.exports = {
async messageRun(message, args) {
let source = MUSIC.DEFAULT_SOURCE;
// Check if the first argument is a valid source
const validSources = ["ytsearch", "ytmsearch", "scsearch", "spsearch", "dzsearch"];
if (validSources.includes(args[0].toLowerCase())) {
source = args.shift().toLowerCase();
}
const query = args.join(" ");
const response = await search(message, query, source);
if (response) await message.safeReply(response);
@ -125,7 +125,7 @@ async function search({ member, guild, channel }, query, source) {
const results = res.tracks.slice(0, maxResults);
const options = results.map((track, index) => ({
label: track.info.title,
label: track.info.title.slice(0, 100),
value: index.toString(),
}));