Update commands to slash commands
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user