mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 21:40:51 +02:00
Space after conditionals
This commit is contained in:
@@ -20,7 +20,7 @@ module.exports = class BinaryCommand extends Command {
|
||||
prompt: 'What text would you like to convert to binary?',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if(binary(text).length < 2000) return true;
|
||||
if (binary(text).length < 2000) return true;
|
||||
return 'Your text is too long.';
|
||||
},
|
||||
parse: text => binary(text)
|
||||
|
||||
@@ -14,7 +14,7 @@ module.exports = class CowsayCommand extends Command {
|
||||
prompt: 'What text would you like the cow to say?',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if(text.length < 1500) return true;
|
||||
if (text.length < 1500) return true;
|
||||
return 'Invalid Text. Text must be under 1500 characters.';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ module.exports = class EmbedCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
if(msg.channel.type !== 'dm')
|
||||
if(!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { text } = args;
|
||||
const embed = new RichEmbed()
|
||||
|
||||
@@ -15,7 +15,7 @@ module.exports = class MorseCommand extends Command {
|
||||
prompt: 'What text would you like to convert to morse?',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if(letterTrans(text, dictionary, ' ').length < 1999) return true;
|
||||
if (letterTrans(text, dictionary, ' ').length < 1999) return true;
|
||||
return 'Your text is too long.';
|
||||
},
|
||||
parse: text => letterTrans(text.toLowerCase(), dictionary, ' ')
|
||||
|
||||
@@ -15,7 +15,7 @@ module.exports = class PirateCommand extends Command {
|
||||
prompt: 'What text would you like to convert to pirate?',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if(wordTrans(text, dictionary).length < 1999) return true;
|
||||
if (wordTrans(text, dictionary).length < 1999) return true;
|
||||
return 'Your text is too long.';
|
||||
},
|
||||
parse: text => wordTrans(text, dictionary)
|
||||
|
||||
@@ -4,10 +4,7 @@ module.exports = class SayCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'say',
|
||||
aliases: [
|
||||
'copy',
|
||||
'echo'
|
||||
],
|
||||
aliases: ['copy', 'echo'],
|
||||
group: 'textedit',
|
||||
memberName: 'say',
|
||||
description: 'Make XiaoBot say what you wish.',
|
||||
@@ -23,7 +20,7 @@ module.exports = class SayCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
if(!msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return msg.say('This Command requires the `Manage Messages` Permission.');
|
||||
const { text } = args;
|
||||
msg.delete();
|
||||
|
||||
@@ -15,7 +15,7 @@ module.exports = class TemmieCommand extends Command {
|
||||
prompt: 'What text would you like to convert to Temmie speak?',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if(wordTrans(text, dictionary).length < 1999) return true;
|
||||
if (wordTrans(text, dictionary).length < 1999) return true;
|
||||
return 'Your text is too long.';
|
||||
},
|
||||
parse: text => wordTrans(text, dictionary)
|
||||
|
||||
@@ -6,9 +6,7 @@ module.exports = class UpsideDownCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'upside-down',
|
||||
aliases: [
|
||||
'udown'
|
||||
],
|
||||
aliases: ['udown'],
|
||||
group: 'textedit',
|
||||
memberName: 'upside-down',
|
||||
description: 'Flips text upside-down.',
|
||||
|
||||
@@ -5,10 +5,7 @@ module.exports = class WebhookCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'webhook',
|
||||
aliases: [
|
||||
'rin',
|
||||
'rin-say'
|
||||
],
|
||||
aliases: ['rin', 'rin-say'],
|
||||
group: 'textedit',
|
||||
memberName: 'webhook',
|
||||
description: 'Posts a message to the webhook defined in your `process.env`.',
|
||||
@@ -28,7 +25,7 @@ module.exports = class WebhookCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if(!msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return msg.say('This Command requires the `Manage Messages` Permission.');
|
||||
const { content } = args;
|
||||
try {
|
||||
@@ -37,7 +34,7 @@ module.exports = class WebhookCommand extends Command {
|
||||
.post(process.env.WEBHOOK_URL)
|
||||
.send({ content });
|
||||
return null;
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
return msg.say(`An Error Occurred: ${err}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ module.exports = class ZalgoCommand extends Command {
|
||||
prompt: 'What text would you like to convert to zalgo?',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if(text.length < 500) return true;
|
||||
if (text.length < 500) return true;
|
||||
return 'Invalid Text. Text must be under 500 characters.';
|
||||
},
|
||||
parse: text => zalgo(text)
|
||||
|
||||
Reference in New Issue
Block a user