From feff30fecc2886b3f48803b5f229b26788d15d7d Mon Sep 17 00:00:00 2001 From: MrMasrozYTLIVE <61359286+MrMasrozYTLIVE@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:00:35 +0300 Subject: [PATCH] Testing if sendMessage argument extends Message class --- chatBot/includes/Client.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chatBot/includes/Client.js b/chatBot/includes/Client.js index 3e222c0..12b7436 100644 --- a/chatBot/includes/Client.js +++ b/chatBot/includes/Client.js @@ -4,6 +4,7 @@ import b4a from "b4a"; import TextMessage from "./TextMessage.js"; import FileMessage from "./FileMessage.js"; import AudioMessage from "./AudioMessage.js"; +import Message from "./Message.js"; class Client extends EventEmitter { constructor(botName) { @@ -86,7 +87,7 @@ class Client extends EventEmitter { } sendMessage(message) { - console.log(typeof message); + console.log(message.prototype instanceof Message); console.log('Bot name:', this.botName); const data = message.toJsonString();