mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 21:40:51 +02:00
Destructuring is Nice
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const commando = require('discord.js-commando');
|
||||
const { Command } = require('discord.js-commando');
|
||||
|
||||
module.exports = class LotteryCommand extends commando.Command {
|
||||
module.exports = class LotteryCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'lottery',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const commando = require('discord.js-commando');
|
||||
const Discord = require('discord.js');
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const math = require('mathjs');
|
||||
|
||||
module.exports = class MathGameCommand extends commando.Command {
|
||||
module.exports = class MathGameCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'mathgame',
|
||||
@@ -51,7 +51,7 @@ module.exports = class MathGameCommand extends commando.Command {
|
||||
const randomValue2 = Math.floor(Math.random() * randomValue) + 1;
|
||||
const randomExpression = randomValue1 + randomType + randomValue2;
|
||||
const solved = math.eval(randomExpression);
|
||||
const embed = new Discord.RichEmbed()
|
||||
const embed = new RichEmbed()
|
||||
.setTitle('You have **ten** seconds to answer:')
|
||||
.setDescription(randomExpression);
|
||||
const embedMsg = await message.embed(embed);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const commando = require('discord.js-commando');
|
||||
const Discord = require('discord.js');
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const request = require('superagent');
|
||||
|
||||
module.exports = class QuizCommand extends commando.Command {
|
||||
module.exports = class QuizCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'quiz',
|
||||
@@ -29,7 +29,7 @@ module.exports = class QuizCommand extends commando.Command {
|
||||
});
|
||||
const data = response.body[0];
|
||||
const answer = data.answer.toLowerCase().split('<i>').join('').split('</i>').join('');
|
||||
const embed = new Discord.RichEmbed()
|
||||
const embed = new RichEmbed()
|
||||
.setTitle('You have **fifteen** seconds to answer this question:')
|
||||
.setDescription(`**Category: ${data.category.title}**\n${data.question}`);
|
||||
const embedMsg = await message.embed(embed);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const commando = require('discord.js-commando');
|
||||
const { Command } = require('discord.js-commando');
|
||||
|
||||
module.exports = class RockPaperScissorsCommand extends commando.Command {
|
||||
module.exports = class RockPaperScissorsCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'rps',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const commando = require('discord.js-commando');
|
||||
const { Command } = require('discord.js-commando');
|
||||
|
||||
module.exports = class SlotsCommand extends commando.Command {
|
||||
module.exports = class SlotsCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'slots',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const commando = require('discord.js-commando');
|
||||
const Discord = require('discord.js');
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
|
||||
module.exports = class TypingGameCommand extends commando.Command {
|
||||
module.exports = class TypingGameCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'typinggame',
|
||||
@@ -51,7 +51,7 @@ module.exports = class TypingGameCommand extends commando.Command {
|
||||
levelWord = 'ten';
|
||||
break;
|
||||
}
|
||||
const embed = new Discord.RichEmbed()
|
||||
const embed = new RichEmbed()
|
||||
.setTitle(`You have **${levelWord}** seconds to type:`)
|
||||
.setDescription(randomSentence);
|
||||
const embedMsg = await message.embed(embed);
|
||||
|
||||
Reference in New Issue
Block a user