Update commands to slash commands

This commit is contained in:
Logan Cusano
2023-02-25 03:25:07 -05:00
parent 49c80b7f5e
commit 02bf0ebda2
16 changed files with 370 additions and 223 deletions

View File

@@ -1,14 +1,21 @@
var libCore = require("../libCore.js");
const libCore = require("../libCore.js");
const { SlashCommandBuilder } = require('discord.js');
const { DebugBuilder } = require("../utilities/debugBuilder");
const log = new DebugBuilder("server", "food");
module.exports = {
name: 'food',
description: 'Food',
async execute(message, args) {
data: new SlashCommandBuilder()
.setName('food')
.setDescription('Gets a random recipe and gives it to you'),
example: "food",
isPrivileged: false,
requiresTokens: false,
async execute(interaction) {
try {
var resultArray = await libCore.getFood();
message.reply(`
await interaction.reply(`
[**${resultArray.strMeal}** - *${resultArray.strCategory}*]
${resultArray.strSource}
@@ -16,8 +23,9 @@ module.exports = {
${resultArray.strMealThumb}
`);
} catch (err) {
message.reply(err.toString());
}
}
};
}catch(err){
log.ERROR(err)
//await interaction.reply(err.toString());
}
}
};