Adding jokes

This commit is contained in:
Raven Scott 2022-09-24 17:24:48 +00:00
parent 0ae5b3d55a
commit 4eb31b689d
3 changed files with 850 additions and 0 deletions

48
commands/general/joke.js Normal file
View File

@ -0,0 +1,48 @@
const {
EmbedBuilder
} = require('discord.js');
var giveMeAJoke = require('give-me-a-joke');
module.exports = {
name: "joke",
description: "Gets a funny joke",
run: async (client, interaction) => {
giveMeAJoke.getRandomDadJoke(function (joke) {
if (joke.includes("?")){
let jokeData = joke.split("?")
const embed = new EmbedBuilder()
.setColor("#FF0000")
.setTitle("Here is your joke...")
.setDescription(jokeData[0] + "?||" + jokeData[1] + "||")
.setTimestamp()
.setFooter({
text: `Requested by ${interaction.user.tag}`,
iconURL: `${interaction.user.displayAvatarURL()}`
});
interaction.editReply({
embeds: [embed]
});
} else {
const embed = new EmbedBuilder()
.setColor("#FF0000")
.setTitle("Here is your joke...")
.setDescription(joke)
.setTimestamp()
.setFooter({
text: `Requested by ${interaction.user.tag}`,
iconURL: `${interaction.user.displayAvatarURL()}`
});
interaction.editReply({
embeds: [embed]
});
}
})
},
};

800
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,8 +10,10 @@
"author": "",
"license": "ISC",
"dependencies": {
"daddyjoke": "^4.0.0",
"discord.js": "^14.0.3",
"dotenv": "^16.0.0",
"give-me-a-joke": "^0.5.1",
"glob": "^7.2.0",
"is-not-defined": "^1.0.1",
"random-text-meme": "^1.1.9",