From 3800809198cf2a2a76be246e464623702536b7f9 Mon Sep 17 00:00:00 2001 From: Tomas Date: Tue, 10 Jul 2018 10:45:54 -0400 Subject: [PATCH] remove logging --- src/functions/receive/index.js | 3 --- src/lib/telegram.js | 9 ++------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/functions/receive/index.js b/src/functions/receive/index.js index b683921..e4171f2 100644 --- a/src/functions/receive/index.js +++ b/src/functions/receive/index.js @@ -22,13 +22,10 @@ export default async (event, context, callback) => { const payload = await Joi.validate(event.body, _bodySchema); // Reply to Telegram directly to stop duplicate messages handleResponse(callback, 200, {}); - console.log('response sent'); // Class const telegram = new Telegram(config); - console.log('class made'); // Send reply message await telegram.sendReply(payload.message); - console.log('Message sent'); } catch (err) { if (err.isJoi) { // tell Telegram to ingore errors, but stop process diff --git a/src/lib/telegram.js b/src/lib/telegram.js index 5200bc9..324ac27 100644 --- a/src/lib/telegram.js +++ b/src/lib/telegram.js @@ -47,15 +47,13 @@ export default class Telegram { * @return {String} - URI for request **/ _prepareLinkResponse(userId, message) { - const response = this.config.TELEGRAM_ENDPOINT + + return (this.config.TELEGRAM_ENDPOINT + this.config.BOT_TOKEN + '/sendmessage?text=' + message.text + message.link + '&chat_id=' + - userId; - console.log(response); - return (response); + userId); } /** @@ -84,7 +82,6 @@ export default class Telegram { * @return {Promise} - Result of request **/ _sendMessage(requestString) { - console.log(requestString); return new Promise((resolve, reject) => { console.log('Sending request to telegram: ' + requestString); this.axios.post(requestString, {}) @@ -129,11 +126,9 @@ export default class Telegram { network: 'telegram', }; if (this._classify(telegramMessage.text) === 'flood') { - console.log('this is a flood message'); this.bot.card(properties) .then((msg) => { const response = this._prepareLinkResponse(properties.userId, msg); - console.log('response', response); resolve(this._sendMessage(response)); }).catch((err) => reject(err)); } else {