Skip to content

Commit

Permalink
[Fix] updated all commands in the Fun category and fixed the 8ball co…
Browse files Browse the repository at this point in the history
…mmand
  • Loading branch information
naseif committed Oct 5, 2021
1 parent 340c184 commit 9df75a7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion commands/Fun/8ball.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
args: true,
usage: "8ball <question>",
description: "Ask the magic ball a question!",
async run(message) {
async run(message, args) {
const question = args.join(" ");

if (!question)
Expand Down
41 changes: 41 additions & 0 deletions commands/Fun/insult.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,48 @@
const { SlashCommandBuilder } = require("@discordjs/builders");
const { embedMessage } = require("../../modules/embedSimple");
const { getUserFromMention } = require("../../modules/getUserFromMention");
const { requestAPI } = require("../../modules/requestAPI");

module.exports = {
name: "insult",
args: true,
description: "Insult your fav user <3",
usage: "insult <user>",
async run(message, args, client) {
if (!args[0])
return await message.channel.send({
embeds: [
embedMessage("#9dcc37", `Please mention your fav user to insult :)`),
],
});

const user = getUserFromMention(args[0], client);

if (!user)
return await message.channel.send({
embeds: [
embedMessage(
"#9dcc37",
`You sure you mentioned the user ?, because I could not resolve the given user`
),
],
});

try {
const insult = await requestAPI(
"https://evilinsult.com/generate_insult.php?lang=en&type=json"
);

await message.channel.send(
`${user ? user : `${message.member.toString()}`}, ${insult.insult}`
);
} catch (error) {
client.logger(error.message, "error");
await message.channel.send(
`Couldn't retrieve Insult, I blame <@503264757785165851>`
);
}
},
data: new SlashCommandBuilder()
.setName("insult")
.setDescription("insult your fav user <3")
Expand Down

0 comments on commit 9df75a7

Please sign in to comment.