fix(*): Rename sendEmbedMessage to generateEmbedMessage

This commit is contained in:
Olly Nicholass
2021-01-15 12:21:55 +00:00
parent 8fbef4dd84
commit 39c34fbce1
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -1,4 +1,4 @@
const { sendEmbedMessage, trim } = require('./helpers.js'); const { generateEmbedMessage, trim } = require('./helpers.js');
const axios = require('axios'); const axios = require('axios');
module.exports = { module.exports = {
@@ -36,8 +36,6 @@ The commands available to you are:
else { else {
message.channel.send(helpMessage); message.channel.send(helpMessage);
} }
} }
function commandUrbanDictionary(Discord, config, logger, message, command, args) { function commandUrbanDictionary(Discord, config, logger, message, command, args) {
@@ -60,7 +58,7 @@ function commandUrbanDictionary(Discord, config, logger, message, command, args)
if (answers.length > 0) { if (answers.length > 0) {
try { try {
// Set up rich embed for the command to return the API response, add the first responses URL with an example of the usage and rating // Set up rich embed for the command to return the API response, add the first responses URL with an example of the usage and rating
const embed = sendEmbedMessage(Discord, logger, message, answers[0].word, trim(Discord, logger, answers[0].definition, 1024)); const embed = generateEmbedMessage(Discord, logger, message, answers[0].word, trim(Discord, logger, answers[0].definition, 1024));
embed.setURL(answers[0].permalink) embed.setURL(answers[0].permalink)
.addFields( .addFields(
{ name: 'Example', value: trim(Discord, logger, answers[0].example, 1024) }, { name: 'Example', value: trim(Discord, logger, answers[0].example, 1024) },
+1 -1
View File
@@ -1,6 +1,6 @@
module.exports = { module.exports = {
// Return a stylised embed for consistancy - this allows you to add additional properties like fields // Return a stylised embed for consistancy - this allows you to add additional properties like fields
sendEmbedMessage: function (Discord, logger, message, title, description, colour = '#F4B400') { generateEmbedMessage : function (Discord, logger, message, title, description, colour = '#F4B400') {
// For documentation see https://github.com/AnIdiotsGuide/discordjs-bot-guide/blob/master/first-bot/using-embeds-in-messages.md // For documentation see https://github.com/AnIdiotsGuide/discordjs-bot-guide/blob/master/first-bot/using-embeds-in-messages.md
try { try {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()