mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 15:57:47 +02:00
String Changes, Don't register tons of defaults
This commit is contained in:
@@ -17,7 +17,7 @@ module.exports = class LotteryCommand extends commando.Command {
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
const lotteryNumber = ['Winner'][Math.floor(Math.random() * 100)];
|
||||
if (lotteryNumber !== "Winner") return message.say(`Nope, sorry ${message.author.username}, you lost.`);
|
||||
if (lotteryNumber !== 'Winner') return message.say(`Nope, sorry ${message.author.username}, you lost.`);
|
||||
return message.say(`Wow ${message.author.username}! You actually won! Great job!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,16 +34,16 @@ module.exports = class MathGameCommand extends commando.Command {
|
||||
randomType = randomType[Math.floor(Math.random() * randomType.length)];
|
||||
let randomValue;
|
||||
switch (level) {
|
||||
case "easy":
|
||||
case 'easy':
|
||||
randomValue = 10;
|
||||
break;
|
||||
case "medium":
|
||||
case 'medium':
|
||||
randomValue = 50;
|
||||
break;
|
||||
case "hard":
|
||||
case 'hard':
|
||||
randomValue = 100;
|
||||
break;
|
||||
case "extreme":
|
||||
case 'extreme':
|
||||
randomValue = 1000;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class QuizCommand extends commando.Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
|
||||
}
|
||||
console.log("[Command] " + message.content);
|
||||
console.log('[Command] ' + message.content);
|
||||
try {
|
||||
const response = await request
|
||||
.get('http://jservice.io/api/random')
|
||||
@@ -28,7 +28,7 @@ module.exports = class QuizCommand extends commando.Command {
|
||||
count: 1
|
||||
});
|
||||
const data = response.body[0];
|
||||
const answer = data.answer.toLowerCase().split("<i>").join("").split("</i>").join("");
|
||||
const answer = data.answer.toLowerCase().split('<i>').join('').split('</i>').join('');
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle('You have **fifteen** seconds to answer this question:')
|
||||
.setDescription(`**Category: ${data.category.title}**\n${data.question}`);
|
||||
@@ -52,7 +52,7 @@ module.exports = class QuizCommand extends commando.Command {
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
return message.say(":x: Error! Something went wrong!");
|
||||
return message.say(':x: Error! Something went wrong!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const commando = require('discord.js-commando');
|
||||
|
||||
module.exports = class RockPaperScissors extends commando.Command {
|
||||
module.exports = class RockPaperScissorsCommand extends commando.Command {
|
||||
constructor(Client) {
|
||||
super(Client, {
|
||||
name: 'rps',
|
||||
@@ -33,37 +33,37 @@ module.exports = class RockPaperScissors extends commando.Command {
|
||||
const rps = args.choice.toLowerCase();
|
||||
let response = ['Paper', 'Rock', 'Scissors'];
|
||||
response = response[Math.floor(Math.random() * response.length)];
|
||||
if (rps === "rock") {
|
||||
if (response === "Rock") {
|
||||
return message.say("Rock! Aw, it's a tie!");
|
||||
if (rps === 'rock') {
|
||||
if (response === 'Rock') {
|
||||
return message.say('Rock! Aw, it\'s a tie!');
|
||||
}
|
||||
if (response === "Paper") {
|
||||
return message.say("Paper! Yes! I win!");
|
||||
if (response === 'Paper') {
|
||||
return message.say('Paper! Yes! I win!');
|
||||
}
|
||||
if (response === "Scissors") {
|
||||
return message.say("Scissors! Aw... I lose...");
|
||||
if (response === 'Scissors') {
|
||||
return message.say('Scissors! Aw... I lose...');
|
||||
}
|
||||
}
|
||||
else if (rps === "paper") {
|
||||
if (response === "Rock") {
|
||||
return message.say("Rock! Aw... I lose...");
|
||||
else if (rps === 'paper') {
|
||||
if (response === 'Rock') {
|
||||
return message.say('Rock! Aw... I lose...');
|
||||
}
|
||||
if (response === "Paper") {
|
||||
return message.say("Paper! Aw, it's a tie!");
|
||||
if (response === 'Paper') {
|
||||
return message.say('Paper! Aw, it\'s a tie!');
|
||||
}
|
||||
if (response === "Scissors") {
|
||||
return message.say("Scissors! Yes! I win!");
|
||||
if (response === 'Scissors') {
|
||||
return message.say('Scissors! Yes! I win!');
|
||||
}
|
||||
}
|
||||
else if (rps === "scissors") {
|
||||
if (response === "Rock") {
|
||||
return message.say("Rock! Yes! I win!");
|
||||
else if (rps === 'scissors') {
|
||||
if (response === 'Rock') {
|
||||
return message.say('Rock! Yes! I win!');
|
||||
}
|
||||
if (response === "Paper") {
|
||||
return message.say("Paper! Aw... I lose...");
|
||||
if (response === 'Paper') {
|
||||
return message.say('Paper! Aw... I lose...');
|
||||
}
|
||||
if (response === "Scissors") {
|
||||
return message.say("Scissors! Aw, it's a tie!");
|
||||
if (response === 'Scissors') {
|
||||
return message.say('Scissors! Aw, it\'s a tie!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,21 +34,21 @@ module.exports = class TypingGameCommand extends commando.Command {
|
||||
let time;
|
||||
let levelWord;
|
||||
switch (level) {
|
||||
case "easy":
|
||||
case 'easy':
|
||||
time = 25000;
|
||||
levelWord = "twenty-five";
|
||||
levelWord = 'twenty-five';
|
||||
break;
|
||||
case "medium":
|
||||
case 'medium':
|
||||
time = 20000;
|
||||
levelWord = "twenty";
|
||||
levelWord = 'twenty';
|
||||
break;
|
||||
case "hard":
|
||||
case 'hard':
|
||||
time = 15000;
|
||||
levelWord = "fifteen";
|
||||
levelWord = 'fifteen';
|
||||
break;
|
||||
case "extreme":
|
||||
case 'extreme':
|
||||
time = 10000;
|
||||
levelWord = "ten";
|
||||
levelWord = 'ten';
|
||||
break;
|
||||
}
|
||||
const embed = new Discord.RichEmbed()
|
||||
|
||||
Reference in New Issue
Block a user