mirror of
https://github.com/ION606/selmerBot.git
synced 2026-06-06 07:12:58 +00:00
Fixed the shop search feature
This commit is contained in:
+4
-5
@@ -138,8 +138,7 @@ client.connect(err => {
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
client.close();
|
client.close().then(function() {
|
||||||
|
const END = d.getTime();
|
||||||
const END = d.getTime();
|
console.log(`Total time in SECONDS: ${(((END - START) % 60000) / 1000).toFixed(0)} ms!`);
|
||||||
|
});
|
||||||
console.log(`Total time in SECONDS: ${(((END - START) % 60000) / 1000).toFixed(0)} ms!`);
|
|
||||||
@@ -45,7 +45,7 @@ function attack(client, user_dbo, other_dbo, bot, thread, command, mongouri, ite
|
|||||||
if (new_hp <= 0) {
|
if (new_hp <= 0) {
|
||||||
winGame(client, bot, client.db(user_dbo.s.namespace.db), user_dbo, xp_collection, interaction.message);
|
winGame(client, bot, client.db(user_dbo.s.namespace.db), user_dbo, xp_collection, interaction.message);
|
||||||
} else {
|
} else {
|
||||||
other_dbo.updateOne({'equipped': {$exists: true}}, { $set: { hp :new_hp }}); //THIS DOES NOT WORK
|
other_dbo.updateOne({'equipped': {$exists: true}}, { $set: { hp :new_hp }}); //THIS DOES NOT WORK (OVERWRITES HPMP MAP WITH ONE VALUE)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -262,9 +262,8 @@ function getShop(message, args, items, bot) {
|
|||||||
noinp = true;
|
noinp = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const items2 = items.slice((ind - 1)*10, (ind - 1)*10+10);
|
const items2 = items.filter(function(f) { return (f.sect.toLowerCase() == args[0].toLowerCase()) }).slice((ind - 1)*10, (ind - 1)*10+10);
|
||||||
newText = Formatters.codeBlock(items2.map(i => `${i.icon} (${i.name}): \$${i.cost}`)
|
newText = Formatters.codeBlock(items2.map(i => `${i.icon} (${i.name}): \$${i.cost}`).join('\n'));
|
||||||
.filter(f => f.sect = args[0]).join('\n'));
|
|
||||||
|
|
||||||
if (noinp) {
|
if (noinp) {
|
||||||
newText += `(Use ${bot.prefix}shop [type] [page number] to access other pages)`;
|
newText += `(Use ${bot.prefix}shop [type] [page number] to access other pages)`;
|
||||||
|
|||||||
Reference in New Issue
Block a user