mirror of
https://github.com/jcreek/MupBot.git
synced 2026-07-12 18:33:44 +00:00
fix(*): Rename sendEmbedMessage to generateEmbedMessage
This commit is contained in:
+2
-4
@@ -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
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user