mirror of
https://github.com/MinazukiAmane/Tinasha-Bot.git
synced 2025-03-15 07:35:57 +08:00
fix long title error
This commit is contained in:
parent
2f0c2c387c
commit
c014979abd
@ -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(),
|
||||
}));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user