mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 05:49:49 +02:00
Change Variable Names, Remove Useless Commands
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const stringToBinary = (str) => {
|
||||
const binary = (str) => {
|
||||
const pad = '00000000';
|
||||
return unescape(encodeURIComponent(str))
|
||||
.split('').map(str => {
|
||||
@@ -19,12 +19,12 @@ module.exports = class BinaryCommand extends Command {
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to binary?',
|
||||
type: 'string',
|
||||
validate: content => {
|
||||
if (stringToBinary(content).length < 2000)
|
||||
validate: text => {
|
||||
if (binary(text).length < 2000)
|
||||
return true;
|
||||
return 'Your message content is too long.';
|
||||
},
|
||||
parse: text => stringToBinary(text)
|
||||
parse: text => binary(text)
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ module.exports = class EmbedCommand extends Command {
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { text } = args;
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(message.author.username, message.author.avatarURL)
|
||||
.setAuthor(message.author.username, message.author.displayAvatarURL)
|
||||
.setColor(0x00AE86)
|
||||
.setTimestamp()
|
||||
.setDescription(text);
|
||||
|
||||
@@ -13,8 +13,8 @@ module.exports = class MorseCommand extends Command {
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to morse?',
|
||||
type: 'string',
|
||||
validate: content => {
|
||||
if (letterTrans(content, dictionary, ' ').length < 1999)
|
||||
validate: text => {
|
||||
if (letterTrans(text, dictionary, ' ').length < 1999)
|
||||
return true;
|
||||
return 'Your message content is too long.';
|
||||
},
|
||||
|
||||
@@ -13,8 +13,8 @@ module.exports = class PirateCommand extends Command {
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to pirate?',
|
||||
type: 'string',
|
||||
validate: content => {
|
||||
if (wordTrans(content, dictionary).length < 1999)
|
||||
validate: text => {
|
||||
if (wordTrans(text, dictionary).length < 1999)
|
||||
return true;
|
||||
return 'Your message content is too long.';
|
||||
},
|
||||
|
||||
@@ -13,8 +13,8 @@ module.exports = class TemmieCommand extends Command {
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to Temmie speak?',
|
||||
type: 'string',
|
||||
validate: content => {
|
||||
if (wordTrans(content, dictionary).length < 1999)
|
||||
validate: text => {
|
||||
if (wordTrans(text, dictionary).length < 1999)
|
||||
return true;
|
||||
return 'Your message content is too long.';
|
||||
},
|
||||
|
||||
@@ -12,11 +12,11 @@ module.exports = class ZalgoCommand extends Command {
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to zalgo?',
|
||||
type: 'string',
|
||||
validate: content => {
|
||||
if (content.length < 500) {
|
||||
validate: text => {
|
||||
if (text.length < 500) {
|
||||
return true;
|
||||
}
|
||||
return `Please keep your text under 500 characters, you have ${content.length}.`;
|
||||
return `Please keep your text under 500 characters, you have ${text.length}.`;
|
||||
},
|
||||
parse: text => zalgo(text)
|
||||
}]
|
||||
|
||||
Reference in New Issue
Block a user