Allow for preliminary support for embeds by passing objects to send function

This commit is contained in:
Evert Prants 2021-03-06 11:37:49 +02:00
parent b4f6300a23
commit a3452fbebb
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
2 changed files with 5 additions and 1 deletions

View File

@ -2,7 +2,7 @@
"main": "plugin.js",
"name": "discord",
"description": "Discord Service for Squeebot 3",
"version": "1.1.0",
"version": "1.1.1",
"tags": ["service", "discord"],
"dependencies": ["control?"],
"npmDependencies": ["discord.js@^12.5.1"]

View File

@ -168,6 +168,10 @@ class DiscordProtocol extends Protocol {
return;
}
}
// Discord supports sending objects to the channel for things like embeds
else if (typeof data[0] === 'object') {
response = data[0];
}
msg.data.channel.send(response).catch((e: Error) => {
logger.error(e);