mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 22:32:50 +02:00
args and more
This commit is contained in:
+10
-14
@@ -12,27 +12,23 @@ module.exports = class PirateCommand extends commando.Command {
|
||||
group: 'textedit',
|
||||
memberName: 'pirate',
|
||||
description: 'Talk like a pirate! (;pirate This is being said like a pirate!)',
|
||||
examples: [';pirate This is being said like a pirate!']
|
||||
examples: [';pirate This is being said like a pirate!'],
|
||||
args: [{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to pirate?',
|
||||
type: 'string'
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
run(message, args) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let turnToPirate = message.content.split(" ").slice(1).join(" ");
|
||||
let turnToPirate = args.text;
|
||||
let pirate = pirateSpeak.translate(turnToPirate);
|
||||
if (!turnToPirate) {
|
||||
return message.channel.send(":x: Error! Nothing to translate!");
|
||||
}
|
||||
else {
|
||||
if (pirate.length > 1950) {
|
||||
return message.channel.send(":x: Error! Your message is too long!");
|
||||
}
|
||||
else {
|
||||
return message.channel.send(pirate);
|
||||
}
|
||||
}
|
||||
if (pirate.length > 1950) return message.channel.send(":x: Error! Your message is too long!");
|
||||
return message.channel.send(pirate);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user