Skip to content

Commit

Permalink
[New] Added new hug command
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Sep 3, 2021
1 parent 22c526b commit f9a9310
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions commands/anime/hug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const { SlashCommandBuilder } = require("@discordjs/builders");
const { requestAPI } = require("../../modules/requestAPI");

module.exports = {
data: new SlashCommandBuilder()
.setName("hug")
.setDescription("sends a hug gif"),
async execute(interaction, client) {
await interaction.deferReply();
try {
const hug = await requestAPI("https://api.waifu.pics/sfw/hug");
const hugEmbed = {
color: "#9dcc37",
image: {
url: `${hug.url}`,
},
timestamp: new Date(),
footer: {
text: `Requested by ${interaction.user.username}`,
icon_url: `${interaction.user.avatarURL()}`,
},
};
await interaction.followUp({ embeds: [hugEmbed] });
} catch (error) {
await interaction.followUp(`Couldn't retrieve a hug gif, Sorry!`);
}
},
};

0 comments on commit f9a9310

Please sign in to comment.