diff --git a/Commands/Bot/eval.js b/Commands/Bot/eval.js index e44c917..ea95349 100644 --- a/Commands/Bot/eval.js +++ b/Commands/Bot/eval.js @@ -14,7 +14,7 @@ module.exports = class extends Command { } async run(message, args, data) { - if (parseInt(message.author.id) !== parseInt(data.config.ownerID)) return message.chat.sendMessage("Vous n'avez pas la permission d'utiliser cette commande.") + if (parseInt(message.author.id) !== parseInt(data.config.ownerID)) return message.chat.sendMessage("You do not have the permission to use this command") let result = new Promise((resolve) => resolve(eval(args.join(` `)))); return result.then((output) => { diff --git a/Commands/Bot/ping.js b/Commands/Bot/ping.js index 00f6992..fd61fc1 100644 --- a/Commands/Bot/ping.js +++ b/Commands/Bot/ping.js @@ -14,7 +14,7 @@ module.exports = class extends Command { } async run(message, args) { - message.chat.sendMessage('Calcul du ping...').then(m => { + message.chat.sendMessage('Fetching ping...').then(m => { m.delete(); message.chat.sendMessage(`My ping is currently at ${(m.timestamp - message.timestamp) / 1000}ms\nI use ${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}mb of RAM`) }) diff --git a/Structure/Client.js b/Structure/Client.js index 8781f3a..6b5f0e6 100644 --- a/Structure/Client.js +++ b/Structure/Client.js @@ -55,7 +55,7 @@ class InstaBot extends Client { if (this.databaseCache.users.get(userID)) { return isLean ? this.databaseCache.users.get(userID).toJSON() : this.databaseCache.users.get(userID); } else { - let userData = (isLean ? await this.usersData.findOne({ id: userID }).populate(`members`).lean() : await this.usersData.findOne({ id: userID }).populate(`members`)); + let userData = (isLean ? await this.usersData.findOne({ id: userID }).populate(`users`).lean() : await this.usersData.findOne({ id: userID }).populate(`users`)); if (userData) { if (!isLean) this.databaseCache.users.set(userID, userData); return userData; @@ -87,16 +87,16 @@ class InstaBot extends Client { async findOrCreateGroup({ groupID: groupID }, isLean) { if (this.databaseCache.groups.get(groupID)) { - return isLean ? this.databaseCache.groupMembers.get(groupID).toJSON() : this.databaseCache.groupMembers.get(groupID); + return isLean ? this.databaseCache.groups.get(groupID).toJSON() : this.databaseCache.groups.get(groupID); } else { - let groupData = (isLean ? await this.groupMembersData.findOne({ groupID: groupID }).populate(`members`).lean() : await this.groupMembersData.findOne({ groupID: groupID }).populate(`members`)); + let groupData = (isLean ? await this.groupsData.findOne({ groupID: groupID }).populate(`groups`).lean() : await this.groupsData.findOne({ groupID: groupID }).populate(`groups`)); if (groupData) { - if (!isLean) this.databaseCache.groupMembers.set(groupID, groupData); + if (!isLean) this.databaseCache.groups.set(groupID, groupData); return groupData; } else { - groupData = new this.groupMembersData({ groupID: groupID }); + groupData = new this.groupsData({ groupID: groupID }); await groupData.save(); - this.databaseCache.groupMembers.set(groupID, groupData); + this.databaseCache.groups.set(groupID, groupData); return isLean ? groupData.toJSON() : groupData; } } diff --git a/package.json b/package.json index c707a13..9572f91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "instabot", - "version": "1.1.9", + "version": "1.2.0", "description": "A fully working instagram bot using Insta.js by androz2091", "main": "index.js", "scripts": {