Skip to content

Commit

Permalink
[New] Added new highfive command
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Sep 3, 2021
1 parent f0b081b commit 22c526b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions commands/anime/highfive.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("highfive")
.setDescription("sends a highfive gif"),
async execute(interaction, client) {
await interaction.deferReply();
try {
const highFive = await requestAPI("https://api.waifu.pics/sfw/highfive");
const highFiveEmbed = {
color: "#9dcc37",
image: {
url: `${highFive.url}`,
},
timestamp: new Date(),
footer: {
text: `Requested by ${interaction.user.username}`,
icon_url: `${interaction.user.avatarURL()}`,
},
};
await interaction.followUp({ embeds: [highFiveEmbed] });
} catch (error) {
await interaction.followUp(`Couldn't retrieve a hug gif, Sorry!`);
}
},
};

0 comments on commit 22c526b

Please sign in to comment.