From dc6e1bdb1cb1fafe1bb7ffc4b9f0dcb89104a28e Mon Sep 17 00:00:00 2001 From: Smidy13 <77650800+Smidy13@users.noreply.github.com> Date: Mon, 20 Sep 2021 14:57:40 +1200 Subject: [PATCH] Bug Fix: Telegram Social Bots sendMessage failing due to changes to Telegram package --- .../TS/Bot-Modules/Trading-Bot/Announcements/TelegramBot.js | 6 ++---- TaskServerRoot.js | 1 - package.json | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Announcements/TelegramBot.js b/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Announcements/TelegramBot.js index 42300bbc7..5fe10448c 100644 --- a/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Announcements/TelegramBot.js +++ b/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Announcements/TelegramBot.js @@ -22,7 +22,7 @@ exports.newFoundationsBotModulesTelegramBot = function (processIndex) { thisObject.chatId = chatId - const Telegraf = SA.nodeModules.telegraf + const { Telegraf } = SA.nodeModules.telegraf thisObject.telegramBot = new Telegraf(botToken) thisObject.telegramBot.start((ctx) => ctx.reply('Hi! I am the Telegram Bot that will tell you what happens with your trading session.')) @@ -41,9 +41,7 @@ exports.newFoundationsBotModulesTelegramBot = function (processIndex) { thisObject.telegramBot.launch() - const Telegram = SA.nodeModules.telegram - - thisObject.telegramAPI = new Telegram(botToken) + thisObject.telegramAPI = thisObject.telegramBot.telegram const message = "Telegram bot is starting. For assistance type /help." thisObject.telegramAPI.sendMessage(thisObject.chatId, message) diff --git a/TaskServerRoot.js b/TaskServerRoot.js index 7da5d0882..65f5a7d23 100644 --- a/TaskServerRoot.js +++ b/TaskServerRoot.js @@ -40,7 +40,6 @@ SA.nodeModules = { ws: require('ws'), ip: require('ip'), telegraf: require('telegraf'), - telegram: require('telegram'), https: require('https'), http: require('http'), web3: require('web3'), diff --git a/package.json b/package.json index f42647859..c0bc424a5 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "path": "^0.12.7", "simple-git": "^2.45.1", "telegraf": "^4.4.2", - "telegram": "^1.8.14", "util": "^0.12.4", "web3": "^1.5.2", "ws": "^8.2.1"