mirror of
				https://github.com/Mestima/luna.git
				synced 2025-10-30 08:02:35 +00:00 
			
		
		
		
	added cat command & api
This commit is contained in:
		
							
								
								
									
										13
									
								
								src/api/cat/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/api/cat/index.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | |||||||
|  | import axios from 'axios'; | ||||||
|  |  | ||||||
|  | const cat = async () => { | ||||||
|  |   return await axios.get('https://aws.random.cat/meow') | ||||||
|  |     .then((res) => { | ||||||
|  |       return res.data.file; | ||||||
|  |     }) | ||||||
|  |     .catch((err) => { | ||||||
|  |       console.log(err); | ||||||
|  |     }); | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | export default { name: 'cat', execute: cat }; | ||||||
							
								
								
									
										13
									
								
								src/commands/cat/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/commands/cat/index.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | |||||||
|  | import { SlashCommandBuilder } from 'discord.js'; | ||||||
|  |  | ||||||
|  | export default { | ||||||
|  |   data: new SlashCommandBuilder() | ||||||
|  |     .setName('cat') | ||||||
|  |     .setDescription('Get a random cat!'), | ||||||
|  |   async execute(interaction, api) { | ||||||
|  |     await api.get('cat')() | ||||||
|  |       .then(async (res) => { | ||||||
|  |         await interaction.reply(res); | ||||||
|  |       }); | ||||||
|  |   } | ||||||
|  | }; | ||||||
		Reference in New Issue
	
	Block a user