From 5b7f587d1e818873ba6f5a0439bb5ebf4266c814 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Mon, 15 Jan 2018 02:58:22 +0000 Subject: [PATCH] Latlmes --- commands/games/hangman.js | 2 +- commands/text-edit/latlmes.js | 32 ++++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 commands/text-edit/latlmes.js diff --git a/commands/games/hangman.js b/commands/games/hangman.js index fca797f3..7b3404e1 100644 --- a/commands/games/hangman.js +++ b/commands/games/hangman.js @@ -15,7 +15,7 @@ module.exports = class HangmanCommand extends Command { this.playing = new Set(); } - async run(msg) { + async run(msg) { // eslint-disable-line complexity if (this.playing.has(msg.channel.id)) return msg.reply('Only one game may be occurring per channel.'); this.playing.add(msg.channel.id); try { diff --git a/commands/text-edit/latlmes.js b/commands/text-edit/latlmes.js new file mode 100644 index 00000000..077e230c --- /dev/null +++ b/commands/text-edit/latlmes.js @@ -0,0 +1,32 @@ +const { Command } = require('discord.js-commando'); + +module.exports = class LatlmesCommand extends Command { + constructor(client) { + super(client, { + name: 'latlmes', + group: 'text-edit', + memberName: 'latlmes', + description: 'Creates a Latlmes fake link that redirects to a rickroll.', + args: [ + { + key: 'section', + prompt: 'What section of the news should the link display?', + type: 'string', + max: 100, + parse: query => encodeURIComponent(query.replace(/ /g, '-').toLowerCase()) + }, + { + key: 'query', + prompt: 'What would you like the link to display as?', + type: 'string', + max: 1000, + parse: query => encodeURIComponent(query.replace(/ /g, '-').toLowerCase()) + } + ] + }); + } + + run(msg, { section, query }) { + return msg.say(`http://www.latlmes.com/${section}/${query}-1`); + } +}; diff --git a/package.json b/package.json index 6b2a72fb..5b08eae8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "61.2.0", + "version": "61.3.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {