Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | 1x 1x | /** * Have butlerbot provide an embedded message with some funny information/helpful links. * @module butlerbot * @return {string} - embedded message to discord text channel */ const Discord = require('discord.js'); module.exports = { name: 'butlerbot', description: 'Introduces butlerbot with a fancy message!', aliases: ['whoareyou', 'whoareu', 'identify'], cooldown: 1, /** * @method execute * @param {string} client - discord bot object, allows us to include certain information about the bot itself * @param {string} message - command, used to determine which channel to return results * @return {string} embedded message */ execute(client, message) { // * Define default values being used for the embedded message /** @var {string} color */ let color = '#9b30af'; /** @var {string} title */ let title = 'Butlerbot is happy to serve.'; /** @var {string} url */ let url = 'https://petewein.github.io/butlerbot/'; /** @var {string[]} author */ let author = [ 'Butlerbot', 'https://cdn0.iconfinder.com/data/icons/scrum-team/448/cloud_ops-512.png', 'https://github.com/PeteWein/butlerbot' ]; /** @var {string} description */ let description = 'A small bot designed to help with simple tasks.'; /** @var {string} thumbnail */ let thumbnail = 'https://funnynamesblog.files.wordpress.com/2015/04/butler-offer.jpg'; /** @var {string[]} addFields */ let addFields = [ {name: 'Have questions?', value: 'Type !help', inline: true}, {name: 'Want a meme?', value: 'Type !meme', inline: true}, {name: 'Looking for documentation?', value: '[Click here](https://petewein.github.io/butlerbot/documentation/index.html)', inline: true}, ]; /** @var {string} image */ let image = 'https://i.chzbgr.com/full/8385259776/h29253DB5/kitteh-butler-caters-to-feline-company'; /** @var {string} footer */ let footer = `Happily performing my duties in ${client.guilds.cache.size} servers.`; /** * @function embedMessage * @param {string} color - color hex code for background of embed image * @param {string} title - title of the embedded message * @param {string} url - link when title is clicked * @param {string} author - embedded message author, author image, and link when author is clicked * @param {string} description - text below title to described embedded message * @param {string} thumbnail - thumbnail image * @param {string} image - upper right corner image * @param {string} footer - display at end of embedded message * @return {Object} embed * @summary create and generate the embedded message */ function embedMessage(color, title, url, author, description, thumbnail, image, footer) { /** * @const embed * @summary embedded message object */ const embed = new Discord.MessageEmbed() .setColor(color) .setTitle(title) .setURL(url) .setAuthor(author[0], author[1], author[2]) .setDescription(description) .setThumbnail(thumbnail) .addFields(addFields) .setImage(image) .setFooter(footer) .setTimestamp(); return embed; } let butlerbotEmbed = embedMessage(color, title, url, author, description, thumbnail, image, footer); message.channel.send(butlerbotEmbed); } }; |