mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 14:04:38 +02:00
args and more
This commit is contained in:
+13
-13
@@ -8,25 +8,25 @@ module.exports = class CowsayCommand extends commando.Command {
|
||||
group: 'textedit',
|
||||
memberName: 'cowsay',
|
||||
description: 'Converts text to cowsay. (;cowsay This text)',
|
||||
examples: [';cowsay This text']
|
||||
examples: [';cowsay This text'],
|
||||
args: [{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like the cow to say?',
|
||||
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}`);
|
||||
if (!message.content.split(" ").slice(1).join(" ")) {
|
||||
return message.channel.send(":x: Error! You entered nothing!");
|
||||
}
|
||||
else {
|
||||
let turnToCowsay = message.content.split(" ").slice(1).join(" ");
|
||||
return message.channel.sendCode(null, cowsay.say({
|
||||
text: turnToCowsay,
|
||||
e: "oO",
|
||||
T: "U "
|
||||
})).catch(error => message.channel.send(':x: Error! Perhaps the content is too long?'));
|
||||
}
|
||||
let turnToCowsay = args.text;
|
||||
return message.channel.sendCode(null, cowsay.say({
|
||||
text: turnToCowsay,
|
||||
e: "oO",
|
||||
T: "U "
|
||||
})).catch(error => message.channel.send(':x: Error! Perhaps the content is too long?'));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user