Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
skysthelimitt committed Jan 13, 2024
2 parents 6123ac2 + 1e43774 commit 57cdd07
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
16 changes: 10 additions & 6 deletions commands/fun/8ball.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ const { SlashCommandBuilder } = require("discord.js");

module.exports = {
data: new SlashCommandBuilder().setName("8ball")
.setDescription("View your current level.")
.setDescription("You ask, and the bot answers!")
.addStringOption((opt) => opt.setName("question").setDescription("Question").setRequired(true)),
async execute(interaction) {
try {
let eightballEmbed = new EmbedBuilder().setTitle("8ball").addFields( { name: interaction.options.getString("question"), value: eightball[Math.round(Math.random() * (eightball.length - 1))]} );
await interaction.reply({ embed: [eightballEmbed] });
let eightballEmbed = new EmbedBuilder()
.setDescription(`> **Question:** ${interaction.options.getString("question")}\n> **Answer:** *${eightball[Math.floor(Math.random() * eightball.length)]}*`)
.setColor("#0099ff")
.setFooter({
text: `requested from ${interaction.user.username}`,
iconURL: interaction.user.displayAvatarURL()
});

await interaction.reply({ embeds: [eightballEmbed] });
} catch (error) {
console.error(error);
await interaction.reply("There was an error. Please ping the owner if you see this.");
Expand All @@ -27,11 +34,8 @@ let eightball = [
"Yes",
"Yes - definitely",
"You may rely on it",
"Reply hazy, try again",
"Ask again later",
"Better not tell you now",
"Cannot predict now",
"Concentrate and ask again",
"Don't count on it",
"My reply is no",
"My sources say no",
Expand Down
7 changes: 5 additions & 2 deletions commands/levels/level.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ module.exports = {
where: { userID: interaction.user.id },
defaults: { level: 1, points: 0 },
});
let levelEmbed = new EmbedBuilder().setTitle("Levels").setDescription(`You are at level ${level.level}, and ${Math.floor(((level.points) / (level.level * 100)) * 100)}% of the way to hitting level ${level.level + 1}!`);
let levelEmbed = new EmbedBuilder()
.setDescription(`> **Level:** ${level.level}\n> **Progress:** ${Math.floor(((level.points) / (level.level * 100)) * 100)}% to level ${level.level + 1}!`)
.setColor("#49ba67");

await interaction.reply({ embeds: [levelEmbed] });
} catch (error) {
console.error(error);
await interaction.reply("There was an error. Please ping the owner if you see this.");
}
},
};
};

0 comments on commit 57cdd07

Please sign in to comment.