Search Fix -> Data correctly grabed by its index

master
masterhc 1 year ago
parent ba70719959
commit 386cb6d79e

@ -50,7 +50,7 @@ class anime extends Command{
{ {
message.delete(); message.delete();
m.message.delete(); m.message.delete();
sendMessage(data[m.customId[m.customId.length-1]-1].id); sendMessage(data[m.customId[m.customId.length-1]].id);
}); });
/** /**
* @param {Number} id * @param {Number} id

@ -42,7 +42,7 @@ class char extends Command{
.setTimestamp() .setTimestamp()
.addFields(fieldPayload); .addFields(fieldPayload);
embeds.unshift(embed); embeds.unshift(embed);
console.log(data.length, embeds.length, embeds) // console.log(data.length, embeds.length, embeds)
const filter = i => i.customId.slice(0,-1) === randomID; const filter = i => i.customId.slice(0,-1) === randomID;
await message.channel.send({ephemeral: true, embeds, components: [row] }); await message.channel.send({ephemeral: true, embeds, components: [row] });
@ -51,7 +51,7 @@ class char extends Command{
{ {
message.delete(); message.delete();
m.message.delete(); m.message.delete();
sendMessage(data[m.customId[m.customId.length-1]-1].id); sendMessage(data[m.customId[m.customId.length-1]].id);
}); });
/** /**
* @param {Number} id * @param {Number} id

@ -53,7 +53,7 @@ class manga extends Command{
{ {
message.delete(); message.delete();
m.message.delete(); m.message.delete();
sendMessage(data[m.customId[m.customId.length-1]-1].id); sendMessage(data[m.customId[m.customId.length-1]].id);
}); });
/** /**
* @param {Number} id * @param {Number} id

@ -15,7 +15,7 @@ app.use(express.json());
app.use(express.urlencoded({extended:true})); app.use(express.urlencoded({extended:true}));
const mongoDB = process.env.mongoDB; const mongoDB = process.env.mongoDB;
const server = http.createServer(app); const server = http.createServer(app);
const io = new Server(server); const io = new Server(server);

Loading…
Cancel
Save