mirror of
https://github.com/jcreek/MupBot.git
synced 2026-07-12 18:33:44 +00:00
feat(*): Change embed helper to return for more flexibilty
This commit is contained in:
+2
-2
@@ -1,4 +1,5 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
|
// Return a stylised embed for consistancy - this allows you to add additional properties like fields
|
||||||
sendEmbedMessage: function (Discord, logger, message, title, description, colour = '#F4B400') {
|
sendEmbedMessage: 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 {
|
||||||
@@ -9,8 +10,7 @@ module.exports = {
|
|||||||
.setFooter('This is a community-made open source bot - if it goes down, fix it')
|
.setFooter('This is a community-made open source bot - if it goes down, fix it')
|
||||||
.setThumbnail('https://cdn.discordapp.com/icons/333376110329069578/b5cf0e90b74a3e1b828c15a262b7a5c8.png?size=128')
|
.setThumbnail('https://cdn.discordapp.com/icons/333376110329069578/b5cf0e90b74a3e1b828c15a262b7a5c8.png?size=128')
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
return embed;
|
||||||
message.channel.send(embed);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Failed to send embed message', error);
|
logger.error('Failed to send embed message', error);
|
||||||
message.channel.send('There was a problem, sorry!');
|
message.channel.send('There was a problem, sorry!');
|
||||||
|
|||||||
Reference in New Issue
Block a user