Prime Command, Remove dankmemes and memeeconomy

This commit is contained in:
Daniel Odendahl Jr
2018-09-16 16:31:07 +00:00
parent c1601bdd8c
commit c442371bae
4 changed files with 36 additions and 4 deletions
+2 -1
View File
@@ -15,7 +15,7 @@ Xiao is a Discord bot coded in JavaScript with
The bot is no longer available for invite. You can self-host the bot, or use her
on the [home server](https://discord.gg/sbMe32W).
## Commands (307)
## Commands (308)
### Utility:
* **eval:** Executes JavaScript code.
@@ -339,6 +339,7 @@ on the [home server](https://discord.gg/sbMe32W).
* **final-grade-calculator:** Determines the grade you need to make on your final to get your desired course grade.
* **gravity:** Determines weight on another planet.
* **math:** Evaluates a math expression.
* **prime:** Determines if a number is a prime number.
* **roman-numeral:** Converts a number to roman numerals.
* **scrabble-score:** Responds with the scrabble score of a word.
* **units:** Converts units to/from other units.
-2
View File
@@ -1,8 +1,6 @@
[
"memes",
"dankmemes",
"surrealmemes",
"memeeconomy",
"wholesomememes",
"tumblr",
"me_irl",
+33
View File
@@ -0,0 +1,33 @@
const Command = require('../../structures/Command');
module.exports = class PrimeCommand extends Command {
constructor(client) {
super(client, {
name: 'prime',
aliases: ['is-prime'],
group: 'number-edit',
memberName: 'prime',
description: 'Determines if a number is a prime number.',
args: [
{
key: 'number',
prompt: 'What number do you want to check?',
type: 'integer',
max: Number.MAX_SAFE_INTEGER
}
]
});
}
run(msg, { number }) {
return msg.reply(`${number} is${this.isPrime(number) ? '' : ' not'} a prime number.`);
}
isPrime(number) {
if (number < 1) return false;
for (let i = 2; i < number; i++) {
if (number % i === 0) return false;
}
return number !== 1 && number !== 0;
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "91.2.3",
"version": "91.3.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {