diff --git a/README.md b/README.md index 60636ccb..645159c9 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,7 @@ served over 10,000 servers with a uniquely devoted fanbase. * **battle**: Engage in a turn-based battle against another user or the AI. * **captcha-quiz**: Try to guess what the captcha says. * **cards-against-humanity**: Compete to see who can come up with the best card to fill in the blank. +* **chance**: Attempt to win with a 1 in 1000 (or your choice) chance of winning. * **emoji-emoji-revolution**: Can you type arrow emoji faster than anyone else has ever typed them before? * **fishy**: Go fishing. * **google-feud**: Attempt to determine the top suggestions for a Google search. @@ -326,7 +327,6 @@ served over 10,000 servers with a uniquely devoted fanbase. * **cleverbot**: Chat with Cleverbot. * **prune**: Deletes up to 99 messages from the current channel. * **strawpoll**: Generates a Strawpoll with the options you provide. -* **timer**: Sets a timer for a certain amount of time. ### Roleplay: diff --git a/commands/analyze/gender.js b/commands/analyze/gender.js index aa00b4bd..51136ed9 100644 --- a/commands/analyze/gender.js +++ b/commands/analyze/gender.js @@ -1,11 +1,11 @@ const { Command } = require('discord.js-commando'); const snekfetch = require('snekfetch'); -module.exports = class GenderGuessCommand extends Command { +module.exports = class GenderAnalyzeCommand extends Command { constructor(client) { super(client, { - name: 'gender-guess', - aliases: ['gender', 'guess-gender', 'analyze-gender', 'gender-analyze'], + name: 'gender-analyze', + aliases: ['gender', 'guess-gender', 'analyze-gender', 'gender-guess'], group: 'analyze', memberName: 'gender', description: 'Determines the gender of a name.', diff --git a/commands/games/chance.js b/commands/games/chance.js new file mode 100644 index 00000000..56603fb8 --- /dev/null +++ b/commands/games/chance.js @@ -0,0 +1,27 @@ +const { Command } = require('discord.js-commando'); + +module.exports = class ChanceCommand extends Command { + constructor(client) { + super(client, { + name: 'chance', + aliases: ['1-in', 'one-in', 'lottery-classic'], + group: 'games', + memberName: 'chance', + description: 'Attempt to win with a 1 in 1000 (or your choice) chance of winning.', + args: [ + { + key: 'chance', + prompt: 'What is the chance of winning? 1 in what?', + type: 'string', + default: 1000 + } + ] + }); + } + + run(msg, { chance }) { + const loss = Math.floor(Math.random() * chance); + if (!loss) return msg.reply('Nice job! 10/10! You deserve some cake!'); + return msg.reply('Nope, sorry, you lost.'); + } +}; diff --git a/commands/info/avatar.js b/commands/info/avatar.js index 314ea37d..6624c8a1 100644 --- a/commands/info/avatar.js +++ b/commands/info/avatar.js @@ -1,5 +1,4 @@ const { Command } = require('discord.js-commando'); -const snekfetch = require('snekfetch'); module.exports = class AvatarCommand extends Command { constructor(client) { @@ -9,7 +8,6 @@ module.exports = class AvatarCommand extends Command { group: 'info', memberName: 'avatar', description: 'Responds with a user\'s avatar.', - clientPermissions: ['ATTACH_FILES'], args: [ { key: 'user', @@ -21,14 +19,8 @@ module.exports = class AvatarCommand extends Command { }); } - async run(msg, { user }) { + run(msg, { user }) { const format = user.avatar && user.avatar.startsWith('a_') ? 'gif' : 'png'; - const avatarURL = user.displayAvatarURL({ format, size: 512 }); - try { - const { body } = await snekfetch.get(avatarURL); - return msg.say({ files: [{ attachment: body, name: `avatar.${format}` }] }); - } catch (err) { - return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } + return msg.say(user.displayAvatarURL({ format, size: 2048 })); } }; diff --git a/commands/other/timer.js b/commands/other/timer.js deleted file mode 100644 index 6f8f417c..00000000 --- a/commands/other/timer.js +++ /dev/null @@ -1,33 +0,0 @@ -const { Command } = require('discord.js-commando'); -const { wait } = require('../../util/Util'); - -module.exports = class TimerCommand extends Command { - constructor(client) { - super(client, { - name: 'timer', - group: 'other', - memberName: 'timer', - description: 'Sets a timer for a certain amount of time.', - args: [ - { - key: 'seconds', - prompt: 'How many seconds do you want to set a timer for?', - type: 'float', - min: 1, - max: 600 - } - ] - }); - - this.timers = new Set(); - } - - async run(msg, { seconds }) { - if (this.timers.has(msg.author.id)) return msg.reply('You can only have one timer at a time.'); - this.timers.add(msg.author.id); - await msg.say(`Setting a timer for ${seconds} seconds...`); - await wait(seconds * 1000); - this.timers.delete(msg.author.id); - return msg.reply('Time\'s up!'); - } -}; diff --git a/package.json b/package.json index 20d332d0..c62f9a7a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "67.1.1", + "version": "68.0.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {