mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-14 21:26:54 +00:00
Fixed the shop search feature
This commit is contained in:
+4
-5
@@ -138,8 +138,7 @@ client.connect(err => {
|
||||
]);
|
||||
});
|
||||
|
||||
client.close();
|
||||
|
||||
const END = d.getTime();
|
||||
|
||||
console.log(`Total time in SECONDS: ${(((END - START) % 60000) / 1000).toFixed(0)} ms!`);
|
||||
client.close().then(function() {
|
||||
const END = d.getTime();
|
||||
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) {
|
||||
winGame(client, bot, client.db(user_dbo.s.namespace.db), user_dbo, xp_collection, interaction.message);
|
||||
} 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;
|
||||
}
|
||||
|
||||
const items2 = items.slice((ind - 1)*10, (ind - 1)*10+10);
|
||||
newText = Formatters.codeBlock(items2.map(i => `${i.icon} (${i.name}): \$${i.cost}`)
|
||||
.filter(f => f.sect = args[0]).join('\n'));
|
||||
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}`).join('\n'));
|
||||
|
||||
if (noinp) {
|
||||
newText += `(Use ${bot.prefix}shop [type] [page number] to access other pages)`;
|
||||
|
||||
Reference in New Issue
Block a user