mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-30 10:56:55 -05:00
508b6a64c7
i see its faster so i use it
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
const cowsay = require('cowsay2')
|
|
const cows = require('cowsay2/cows')
|
|
const { EmbedBuilder } = require('discord.js')
|
|
module.exports = {
|
|
name: 'cowsay',
|
|
alias: [],
|
|
description: 'Moo',
|
|
usage: [
|
|
'cow <message>',
|
|
'list (not support on Discord)'
|
|
],
|
|
trusted: 0,
|
|
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
|
|
if (args[0] === 'list') {
|
|
const listed = Object.keys(cows)
|
|
|
|
let primary = true
|
|
const message = []
|
|
|
|
for (const value of listed) {
|
|
message.push({
|
|
text: value + ' ',
|
|
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
|
|
clickEvent: {
|
|
action: 'suggest_command',
|
|
value: `${prefix}cowsay ${value} `
|
|
}
|
|
})
|
|
}
|
|
|
|
bot.tellraw(selector, message)
|
|
} else {
|
|
bot.tellraw(selector, { text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
|
|
}
|
|
},
|
|
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
|
|
const Embed = new EmbedBuilder()
|
|
.setColor(config.discord.embedsColors.normal)
|
|
.setTitle('Cowsay')
|
|
.setDescription(cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }))
|
|
channeldc.send({ embeds: [Embed] })
|
|
}
|
|
}
|