Skip to content

Commit

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

0 comments on commit 21b1cff

Please sign in to comment.