mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 15:57:54 +02:00
Make Code Prettier
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)
|
||||
if(binary(text).length < 2000)
|
||||
return true;
|
||||
return 'Your message content is too long.';
|
||||
},
|
||||
|
||||
@@ -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)
|
||||
if(text.length < 1500)
|
||||
return true;
|
||||
return `Please keep your content under 1500 characters, you have ${text.length}.`;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
if(letterTrans(text, dictionary, ' ').length < 1999)
|
||||
return true;
|
||||
return 'Your message content is too long.';
|
||||
},
|
||||
|
||||
@@ -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)
|
||||
if(wordTrans(text, dictionary).length < 1999)
|
||||
return true;
|
||||
return 'Your message content is too long.';
|
||||
},
|
||||
|
||||
@@ -24,7 +24,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)
|
||||
if(wordTrans(text, dictionary).length < 1999)
|
||||
return true;
|
||||
return 'Your message content is too long.';
|
||||
},
|
||||
|
||||
@@ -28,16 +28,16 @@ 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 {
|
||||
msg.delete();
|
||||
await request
|
||||
.post(process.env.WEBHOOK_URL)
|
||||
.send({content});
|
||||
.send({ content });
|
||||
return null;
|
||||
} catch (err) {
|
||||
} catch(err) {
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
if(text.length < 500) {
|
||||
return true;
|
||||
}
|
||||
return `Please keep your text under 500 characters, you have ${text.length}.`;
|
||||
|
||||
Reference in New Issue
Block a user