Adding jokes
This commit is contained in:
parent
0ae5b3d55a
commit
4eb31b689d
48
commands/general/joke.js
Normal file
48
commands/general/joke.js
Normal 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
800
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user