Fixes.
Put CatFact and DogFact into the "Fun" category while also adding a discord disconnect and reconnect logger.
This commit is contained in:
		
							parent
							
								
									a91d4774eb
								
							
						
					
					
						commit
						e2403b6cbe
					
				
					 5 changed files with 36 additions and 3 deletions
				
			
		| 
						 | 
					@ -3,7 +3,7 @@ const request = require("request");
 | 
				
			||||||
exports.run = async (bot, message, args) => {
 | 
					exports.run = async (bot, message, args) => {
 | 
				
			||||||
  request({ uri: "https://catfact.ninja/facts", json: true }, (error, response, body) => {
 | 
					  request({ uri: "https://catfact.ninja/facts", json: true }, (error, response, body) => {
 | 
				
			||||||
    if (error) throw new Error(error);
 | 
					    if (error) throw new Error(error);
 | 
				
			||||||
    message.channel.send(`**Did you know?**\n ${body.facts[0]}`);
 | 
					    message.channel.send(`**Did you know?**\n ${body.data[0].facts}`);
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,7 +17,7 @@ exports.conf = {
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  exports.help = {
 | 
					  exports.help = {
 | 
				
			||||||
    name: "catfact",
 | 
					    name: "catfact",
 | 
				
			||||||
    category: "User",
 | 
					    category: "Fun",
 | 
				
			||||||
    description: "Sends a fun fact about a cat.",
 | 
					    description: "Sends a fun fact about a cat.",
 | 
				
			||||||
    usage: "catfact/kittenfact"
 | 
					    usage: "catfact/kittenfact"
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										27
									
								
								src/commands/dicerole.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								src/commands/dicerole.js
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,27 @@
 | 
				
			||||||
 | 
					exports.run = async (bot, message, args) => {
 | 
				
			||||||
 | 
					    if (args.length === 0) {
 | 
				
			||||||
 | 
					      message.channel.send(`🎲 The dice landed on ${Array.from(Array(6).keys()).random() + 1}.`);
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      if (args[0].match(/^\d+$/)) {
 | 
				
			||||||
 | 
					        message.channel.send(`🎲 The dice landed on ${Array.from(Array(parseInt(args[0])).keys()).random() + 1}.`);
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        message.channel.send(`🎲 The dice landed on ${Array.from(Array(6).keys()).random() + 1}.`);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  exports.conf = {
 | 
				
			||||||
 | 
					    enabled: true,
 | 
				
			||||||
 | 
					    guildOnly: false,
 | 
				
			||||||
 | 
					    aliases: ["diceroll"],
 | 
				
			||||||
 | 
					    permLevel: "User",
 | 
				
			||||||
 | 
					    requiredPerms: []
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  exports.help = {
 | 
				
			||||||
 | 
					    name: "dice",
 | 
				
			||||||
 | 
					    category: "Fun",
 | 
				
			||||||
 | 
					    description: "Rolls a dice.",
 | 
				
			||||||
 | 
					    usage: "dice"
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
| 
						 | 
					@ -17,7 +17,7 @@ exports.conf = {
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  exports.help = {
 | 
					  exports.help = {
 | 
				
			||||||
    name: "dogfact",
 | 
					    name: "dogfact",
 | 
				
			||||||
    category: "User",
 | 
					    category: "Fun",
 | 
				
			||||||
    description: "Sends a fun fact about a doggo.",
 | 
					    description: "Sends a fun fact about a doggo.",
 | 
				
			||||||
    usage: "dogfact/pupfact"
 | 
					    usage: "dogfact/pupfact"
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										3
									
								
								src/events/disconnect.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/events/disconnect.js
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					module.exports = client => { // logs if the bot gets disconnected from discord.
 | 
				
			||||||
 | 
						client.logger.warn(`Bot disconnected at ${new Date()}`);
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
							
								
								
									
										3
									
								
								src/events/reconnection.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/events/reconnection.js
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					module.exports = client => { // logs when the bot reconnects to discord
 | 
				
			||||||
 | 
						client.logger.info(`Reconnecting at ${new Date()}`);
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue