mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 22:32:52 +02:00
Examples too
This commit is contained in:
@@ -34,10 +34,10 @@ module.exports = class UrbanDictionaryCommand extends Command {
|
|||||||
.setAuthor('Urban Dictionary', 'https://i.imgur.com/Fo0nRTe.png', 'https://www.urbandictionary.com/')
|
.setAuthor('Urban Dictionary', 'https://i.imgur.com/Fo0nRTe.png', 'https://www.urbandictionary.com/')
|
||||||
.setURL(data.permalink)
|
.setURL(data.permalink)
|
||||||
.setTitle(data.word)
|
.setTitle(data.word)
|
||||||
.setDescription(shorten(data.definition.replace(/\[\]/g, '')))
|
.setDescription(shorten(data.definition.replace(/\[|\]/g, '')))
|
||||||
.setFooter(`👍 ${formatNumber(data.thumbs_up)} 👎 ${formatNumber(data.thumbs_down)}`)
|
.setFooter(`👍 ${formatNumber(data.thumbs_up)} 👎 ${formatNumber(data.thumbs_down)}`)
|
||||||
.setTimestamp(new Date(data.written_on))
|
.setTimestamp(new Date(data.written_on))
|
||||||
.addField('❯ Example', data.example ? shorten(data.example, 1000) : 'None');
|
.addField('❯ Example', data.example ? shorten(data.example.replace(/\[|\]/g, ''), 1000) : 'None');
|
||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
|
|||||||
Reference in New Issue
Block a user