chomens-bot-js/commands/urban.js

20 lines
739 B
JavaScript
Raw Normal View History

2022-11-27 02:35:28 -05:00
const urban = require('urban-dictionary')
2022-08-14 05:51:45 -04:00
module.exports = {
name: 'urban',
alias: [],
description: 'Working Urban Dictionary',
usage: '<word>',
trusted: 0,
2022-12-31 20:02:04 -05:00
async execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) {
try {
const definitions = await urban.define(args.join(' '))
2022-12-31 20:02:04 -05:00
for (const definition of definitions) {
bot.tellraw(selector, [{ text: '[', color: 'dark_red' }, { text: 'Urban', color: 'red' }, { text: '] ', color: 'dark_red' }, { text: definition.word, color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition, color: 'white' }])
}
} catch (e) {
bot.tellraw(selector, { text: e.toString(), color: 'red' })
2022-12-31 20:02:04 -05:00
}
2022-11-27 02:35:28 -05:00
}
}