ravenbotv14/commands/untils/activity.js

27 lines
813 B
JavaScript
Raw Normal View History

2022-09-25 01:14:14 -04:00
const { EmbedBuilder } = require('discord.js');
var unirest = require('unirest');
module.exports = {
name: "bored",
description: "Find an activity to do when you are bored.",
run: async (client, interaction) => {
unirest
.get('https://www.boredapi.com/api/activity')
.headers({
'Accept': 'application/json', 'Content-Type': 'application/json',
})
.then((response) => {
let data = response.body
const embed = new EmbedBuilder()
.setColor("#FF0000")
.setTitle("🏓 Pong!")
.setDescription(data.activity)
.setTimestamp()
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
interaction.followUp({ embeds: [embed] });
})
},
};