From a3452fbebb0151e9275457ddce5bb2265320d295 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Sat, 6 Mar 2021 11:37:49 +0200 Subject: [PATCH] Allow for preliminary support for embeds by passing objects to send function --- discord/plugin.json | 2 +- discord/plugin.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/discord/plugin.json b/discord/plugin.json index 0c2f6f7..a2abc15 100644 --- a/discord/plugin.json +++ b/discord/plugin.json @@ -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"] diff --git a/discord/plugin.ts b/discord/plugin.ts index 163ec5f..c1164f5 100644 --- a/discord/plugin.ts +++ b/discord/plugin.ts @@ -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);