mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 15:57:50 +02:00
Fix All the Crap
This commit is contained in:
@@ -13,10 +13,7 @@ module.exports = class MathGameCommand extends commando.Command {
|
||||
args: [{
|
||||
key: 'difficulty',
|
||||
prompt: 'What difficulty should the math game be? Easy, Medium, Hard, or Extreme?',
|
||||
type: 'string',
|
||||
validate: (str) => {
|
||||
str.toLowerCase() === 'easy' || str.toLowerCase() === 'medium' || str.toLowerCase() === 'hard' || str.toLowerCase() === 'extreme';
|
||||
}
|
||||
type: 'string'
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -26,7 +23,8 @@ module.exports = class MathGameCommand extends commando.Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let level = args.difficulty;
|
||||
let level = args.difficulty.toLowerCase();
|
||||
if (level !== 'easy' || level !== 'medium' || level !== 'hard' || level !== 'extreme') return message.channel.send(':x: Error! Please set the difficulty to either easy, medium, hard, or extreme!');
|
||||
let randomType = ['+', '-', '*'];
|
||||
randomType = randomType[Math.floor(Math.random() * randomType.length)];
|
||||
let randomValue;
|
||||
|
||||
@@ -15,9 +15,6 @@ module.exports = class RockPaperScissors extends commando.Command {
|
||||
key: 'choice',
|
||||
prompt: 'Rock, Paper, or Scissors?',
|
||||
type: 'string',
|
||||
validate: (str) => {
|
||||
str.toLowerCase() === 'rock' || str.toLowerCase() === 'paper' || str.toLowerCase() === 'scissors';
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -27,7 +24,7 @@ module.exports = class RockPaperScissors extends commando.Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let rps = args.choice;
|
||||
let rps = args.choice.toLowerCase();
|
||||
let response = ['Paper', 'Rock', 'Scissors'];
|
||||
response = response[Math.floor(Math.random() * response.length)];
|
||||
if (rps.includes("rock")) {
|
||||
@@ -63,5 +60,6 @@ module.exports = class RockPaperScissors extends commando.Command {
|
||||
return message.channel.send("Scissors! Aw, it's a tie!");
|
||||
}
|
||||
}
|
||||
else return message.channel.send(':x: Error! Please enter rock, paper, or scissors!');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -12,10 +12,7 @@ module.exports = class TypingGameCommand extends commando.Command {
|
||||
args: [{
|
||||
key: 'difficulty',
|
||||
prompt: 'What difficulty should the typing game be? Easy, Medium, Hard, or Extreme?',
|
||||
type: 'string',
|
||||
validate: (str) => {
|
||||
str.toLowerCase() === 'easy' || str.toLowerCase() === 'medium' || str.toLowerCase() === 'hard' || str.toLowerCase() === 'extreme';
|
||||
}
|
||||
type: 'string'
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -25,7 +22,8 @@ module.exports = class TypingGameCommand extends commando.Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let level = args.difficulty;
|
||||
let level = args.difficulty.toLowerCase();
|
||||
if (level !== 'easy' || level !== 'medium' || level !== 'hard' || level !== 'extreme') return message.channel.send(':x: Error! Please set the difficulty to either easy, medium, hard, or extreme!');
|
||||
let randomSentence = ['The quick brown fox jumps over the lazy dog.', 'Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.', 'How razorback-jumping frogs can level six piqued gymnasts!', 'Amazingly few discotheques provide jukeboxes.'];
|
||||
randomSentence = randomSentence[Math.floor(Math.random() * randomSentence.length)];
|
||||
let time;
|
||||
|
||||
Reference in New Issue
Block a user