const { otter } = require('#api'); const { createEmbed } = require('#utils/embed'); const { acknowledge } = require('#utils/interactions'); const { editOrReply } = require('#utils/message') const { ApplicationCommandOptionTypes } = require("detritus-client/lib/constants"); module.exports = { description: 'Shows a random otter picture.', name: 'otter', contexts: [ 0, 1, 2 ], integrationTypes: [ 1 ], options: [ { name: 'incognito', description: 'Makes the response only visible to you.', type: ApplicationCommandOptionTypes.BOOLEAN, required: false, default: false } ], run: async (context, args) => { await acknowledge(context, args.incognito); try{ const ott = (await otter()).response.body return editOrReply(context, createEmbed("default", context, { image: { url: ott.url } })) }catch(e){ console.log(e) return editOrReply(context, createEmbed("error", context, `Unable to fetch otter.`)) } } };