Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const urban = require('relevant-urban'),
- Discord = require('discord.js');
- module.exports.run = async (client, message, args, tools) => {
- if (!args[0]) return message.channel.send(`**Please specify some text!`);
- let res = await urban(args.join(' ')).catch(e => {
- return message.channel.send('Sorry, that word was not found!');
- let embed = new Discord.RichEmbed()
- .setColor('RANDOM')
- .setTitle(res.word)
- .setUrl(res.urbanURL)
- .setDescription(`Definition: \n${res.definition}\n\nExample:\n${res.example}`)
- .setField('Author', res.author, true)
- .addField('Rating',`Upvotes: ${res.thumbsUp} | Downvotes: ${res.thumbsDown}`);
- if (res.tags.length > 0 && res.tags.join(' ').length < 1024) {
- embed.addField('Tags', res.tags.join(', '), true)
- message.channel.send(embed);
- }
- }
- );
- }
- module.exports.help = {
- name: "Urban Dictionary",
- usage: "ud <word>",
- description: "Command used find definitions of words in the urban dictionary."
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement