mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-23 23:57:57 -05:00
cowsay list
This commit is contained in:
parent
35d1429c60
commit
1d8a885f17
2 changed files with 19 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
||||||
[
|
[
|
||||||
"Remove pig and cow command",
|
"Remove pig and cow command",
|
||||||
"*entity now uses minecraft-data",
|
"*entity now uses minecraft-data",
|
||||||
"*cowsay cow support"
|
"*cowsay cow support",
|
||||||
|
"*cowsay list"
|
||||||
]
|
]
|
|
@ -5,9 +5,24 @@ module.exports = {
|
||||||
name: 'cowsay',
|
name: 'cowsay',
|
||||||
alias: [],
|
alias: [],
|
||||||
description: 'Moo',
|
description: 'Moo',
|
||||||
usage: '<cow> <message>',
|
usage: '<cow|list> <message>',
|
||||||
trusted: 0,
|
trusted: 0,
|
||||||
execute: function(bot, username, usernameraw, sender, prefix, args) {
|
execute: function(bot, username, usernameraw, sender, prefix, args) {
|
||||||
bot.core.run('minecraft:tellraw @a ' + JSON.stringify({text: `${cowsay.say(args.slice(1).join(' '), {cow: cows[args[0]]})}`}));
|
if (args[0]!=='list') {
|
||||||
|
bot.core.run('minecraft:tellraw @a ' + JSON.stringify({text: `${cowsay.say(args.slice(1).join(' '), {cow: cows[args[0]]})}`}));
|
||||||
|
} else {
|
||||||
|
let color = '§6';
|
||||||
|
let message = '';
|
||||||
|
|
||||||
|
Object.keys(cows).forEach((value) => {
|
||||||
|
if (color==='§6') {
|
||||||
|
color = '§e';
|
||||||
|
} else if (color==='§e') {
|
||||||
|
color = '§6';
|
||||||
|
};
|
||||||
|
message += color + value + ' ';
|
||||||
|
});
|
||||||
|
bot.core.run('minecraft:tellraw @a ' + JSON.stringify([{text: 'Cows: ', color: 'green'}, '\n', {text: message, color: 'red'}]));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue