Use lean() method on read-only database calls
This commit is contained in:
		
							parent
							
								
									881dfd34d7
								
							
						
					
					
						commit
						88dd0c6172
					
				
					 3 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -6,7 +6,7 @@ const paginator = require("../utils/pagination/pagination.js");
 | 
			
		|||
const tips = ["You can change the bot's prefix using the prefix command.", "Image commands also work with images previously posted in that channel.", "You can use the tags commands to save things for later use.", "You can visit https://projectlounge.pw/esmBot/help.html for a web version of this command list.", "You can view a command's aliases by putting the command name after the help command (e.g. help image).", "Parameters wrapped in [] are required, while parameters wrapped in {} are optional."];
 | 
			
		||||
 | 
			
		||||
exports.run = async (message, args) => {
 | 
			
		||||
  const guild = (await database.guilds.find({ id: message.channel.guild.id }).exec())[0];
 | 
			
		||||
  const guild = (await database.guilds.find({ id: message.channel.guild.id }).lean().exec())[0];
 | 
			
		||||
  const commands = collections.commands;
 | 
			
		||||
  const aliases = collections.aliases;
 | 
			
		||||
  if (args.length !== 0 && (commands.has(args[0].toLowerCase()) || aliases.has(args[0].toLowerCase()))) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue