Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #92 from mrepol742/master
Browse files Browse the repository at this point in the history
Initial Commit
  • Loading branch information
mrepol742 authored Mar 11, 2024
2 parents 5756266 + 234ced7 commit fe37a31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ async function ai22(api, event, query, query2) {
}
if (musicSearch || videoSearch) {
for (let q in musicSearch) {
if (musicSearch[q] && event.messageReply.messageID == musicSearch[q]) {
if (musicSearch[q] && event.messageReply.messageID == musicSearch[q].messageID) {
if (/^\d+$/.test(input)) {
switch (input) {
case "1":
Expand All @@ -1467,7 +1467,7 @@ async function ai22(api, event, query, query2) {
}
}
for (let q in videoSearch) {
if (videoSearch[q] && event.messageReply.messageID == videoSearch[q]) {
if (videoSearch[q] && event.messageReply.messageID == videoSearch[q].messageID) {
if (/^\d+$/.test(input)) {
switch (input) {
case "1":
Expand Down Expand Up @@ -3308,10 +3308,10 @@ async function ai(api, event) {
let thumbnails = [];
let time = utils.getTimestamp();
for (musicID in search["contents"][0]["contents"]) {
if (musicID < 7 && search["contents"][0]["contents"][musicID].type == "MusicResponsiveListItem") {
if (musicID < 6 && search["contents"][0]["contents"][musicID].type == "MusicResponsiveListItem") {
stringBuilder += parseInt(musicID) + 1 + ". " + search["contents"][0]["contents"][musicID].title;
stringBuilder += "\n" + search["contents"][0]["contents"][musicID].duration.text + " minutes";
if (musicID != 6) stringBuilder += "\n-------\n";
if (musicID != 5) stringBuilder += "\n-------\n";
let fname = __dirname + "/cache/musicsearch" + musicID + "_" + time + ".png";
await downloadFile(encodeURI(search["contents"][0]["contents"][musicID].thumbnails[0].url), fname).then((response1) => {
thumbnails.push(fname);
Expand Down

0 comments on commit fe37a31

Please sign in to comment.