Created
March 6, 2022 07:11
-
-
Save trezy/d65431c31017b390fea9424ad5a00b40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Module imports | |
import { MessageEmbed } from 'discord.js' | |
// Local imports | |
import { Command } from '../structures/Command.js' | |
import { fortunes } from '../../data/fortunes.js' | |
import { getRandomFortune } from '../helpers/database.js' | |
import { logger } from '../helpers/logger.js' | |
export default new Command({ | |
// Meta | |
name: 'fortune', | |
description: 'Get a fortune from Trezy\'s jar!', | |
// Functionality | |
execute: async interaction => { | |
const { data: fortune } = await getRandomFortune() | |
const response = new MessageEmbed | |
response.setTitle(`🥠 ${fortune.body}`) | |
response.addFields({ | |
name: 'Lucky Numbers', | |
value: fortune.luckyNumbers.join(', '), | |
inline: true, | |
}) | |
response.addFields({ | |
name: 'Opened', | |
value: fortune.originallyOpened || 'Before 04 March, 2022', | |
inline: true, | |
}) | |
await interaction.reply({ | |
embeds: [response], | |
}) | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment