Skip to content

Commit

Permalink
Update 2 files
Browse files Browse the repository at this point in the history
  • Loading branch information
magneum committed Jun 4, 2023
1 parent 5ce5b6a commit fbd3dbf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10,708 deletions.
43 changes: 24 additions & 19 deletions app/models/๐Ÿ”ŽSearches/ytsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
// โ•šโ—Ž โš™๏ธ๐ƒ๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ž๐ซ๐ฌ: +๐Ÿ—๐Ÿ๐Ÿ–๐Ÿ’๐Ÿ‘๐Ÿ”๐Ÿ”๐Ÿ–๐Ÿ”๐Ÿ•๐Ÿ“๐Ÿ– & +๐Ÿ—๐Ÿ๐Ÿ–๐Ÿ๐Ÿ“๐ŸŽ๐Ÿ–๐Ÿ–๐Ÿ—๐Ÿ‘๐Ÿ๐Ÿ“
"โ—Žโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑ( โ’ธ๐๐ฅ๐จ๐จ๐ฆ๐๐จ๐ญ (๐ฆ๐ฎ๐ฅ๐ญ๐ข-๐๐ž๐ฏ๐ข๐œ๐ž) ๐›๐ฒ ๐Œ๐š๐ ๐ง๐ž๐ฎ๐ฆโ„ข )โ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ˜ฑโ—Ž";
require("#/config/index.js");
const ppth = require("path");
const tpth = ppth.basename(__filename);
const currFile = tpth.slice(0, -3).toLowerCase();
const path = require("path");
const filePath = path.basename(__filename);
const currentFile = filePath.slice(0, -3).toLowerCase();

module.exports = async (
BloomBot,
chatkey,
Expand All @@ -51,32 +52,36 @@ module.exports = async (
> _No query provided!_
*๐ŸŒปUsage:*
> _${BloomBot.prefix}${currFile} song-name_`,
> _${BloomBot.prefix}${currentFile} song-name_`,
);
}

const no = 1;
const search = await BloomBot.ySearch(BloomBot.args.join(" "));
const Fetched =
`*๐ŸŒปHere, ${currFile} for @${
BloomBot.tagname || BloomBot.pushname
}:\n\n Result for ` +
BloomBot.args.join(" ") +
"\n\n";
for (const i of search.all) {
Fetched += `#${no++}> *๐Ÿœ๏ธTitle*: ${i.title}
*๐ŸŒธDuration*: ${i.timestamp}
*๐ŸŒUrl*: ${i.url}
\n`;
const searchQuery = BloomBot.args.join(" ");
const searchResults = await BloomBot.ySearch(searchQuery);

let fetchedData = `*๐ŸŒปHere are the search results for "${searchQuery}"*\n\n`;
fetchedData += `Requested by: ${BloomBot.tagname || BloomBot.pushname}\n\n`;

let resultNumber = 1;
for (const result of searchResults.all) {
fetchedData += `#${resultNumber}\n`;
fetchedData += `๐Ÿœ๏ธ *Title*: ${result.title}\n`;
fetchedData += `๐ŸŒธ *Duration*: ${result.timestamp}\n`;
fetchedData += `๐ŸŒ *URL*: ${result.url}\n\n`;
resultNumber++;
}

const thumbnailUrl = searchResults.all[0].thumbnail;

return await BloomBot.imagebutton(
BloomBot,
chatkey,
`${Fetched}`,
search.all[0].thumbnail,
fetchedData,
thumbnailUrl,
);
} catch (error) {
return BloomBot.handlerror(BloomBot, chatkey, error);
}
};

module.exports.aliases = [];
Loading

0 comments on commit fbd3dbf

Please sign in to comment.