2022-11-27 02:35:28 -05:00
|
|
|
const cowsay = require('cowsay2')
|
|
|
|
const cows = require('cowsay2/cows')
|
2022-12-24 00:59:52 -05:00
|
|
|
const { EmbedBuilder } = require('discord.js')
|
2022-08-14 05:51:45 -04:00
|
|
|
module.exports = {
|
|
|
|
name: 'cowsay',
|
|
|
|
alias: [],
|
|
|
|
description: 'Moo',
|
2022-11-23 06:10:45 -05:00
|
|
|
usage: [
|
2022-12-12 06:37:29 -05:00
|
|
|
'cow <message>',
|
|
|
|
'list (not support on Discord)'
|
2022-11-23 06:10:45 -05:00
|
|
|
],
|
2022-08-14 05:51:45 -04:00
|
|
|
trusted: 0,
|
2022-12-14 08:51:30 -05:00
|
|
|
execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
|
2022-11-27 02:35:28 -05:00
|
|
|
if (args[0] === 'list') {
|
|
|
|
const listed = Object.keys(cows)
|
2022-08-28 00:39:31 -04:00
|
|
|
|
2022-11-27 02:35:28 -05:00
|
|
|
let primary = true
|
|
|
|
const message = []
|
2022-11-08 09:01:38 -05:00
|
|
|
|
2023-01-23 07:19:49 -05:00
|
|
|
for (const value of listed) {
|
2022-11-08 09:01:38 -05:00
|
|
|
message.push({
|
|
|
|
text: value + ' ',
|
2022-11-18 05:10:34 -05:00
|
|
|
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
|
2022-11-08 09:01:38 -05:00
|
|
|
clickEvent: {
|
|
|
|
action: 'suggest_command',
|
2022-11-27 02:35:28 -05:00
|
|
|
value: `${prefix}cowsay ${value} `
|
|
|
|
}
|
|
|
|
})
|
2023-01-23 07:19:49 -05:00
|
|
|
}
|
2022-11-08 09:01:38 -05:00
|
|
|
|
2022-11-27 02:35:28 -05:00
|
|
|
bot.tellraw(selector, message)
|
2022-11-07 08:08:29 -05:00
|
|
|
} else {
|
2022-11-27 02:35:28 -05:00
|
|
|
bot.tellraw(selector, { text: cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }) })
|
2022-08-28 00:39:31 -04:00
|
|
|
}
|
2022-08-14 05:51:45 -04:00
|
|
|
},
|
2022-12-14 08:51:30 -05:00
|
|
|
discordExecute (bot, username, sender, prefix, args, channeldc, message, config) {
|
2022-12-24 00:59:52 -05:00
|
|
|
const Embed = new EmbedBuilder()
|
2022-12-01 05:15:30 -05:00
|
|
|
.setColor(config.discord.embedsColors.normal)
|
2022-11-27 02:35:28 -05:00
|
|
|
.setTitle('Cowsay')
|
|
|
|
.setDescription(cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] }))
|
|
|
|
channeldc.send({ embeds: [Embed] })
|
|
|
|
}
|
|
|
|
}
|