From 6d3c2fdb8348827b2d9e82e8e847e85340603b2c Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 19 Nov 2017 18:41:04 +0200 Subject: [PATCH] Remove useless telegram-mtproto v2 support --- src/telegram-puppet.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/telegram-puppet.js b/src/telegram-puppet.js index 1911cef1..38647da4 100644 --- a/src/telegram-puppet.js +++ b/src/telegram-puppet.js @@ -283,7 +283,6 @@ class TelegramPuppet { } handleUpdate(data) { - console.log("UPDATE", data) try { switch (data._) { case "updateShort": @@ -308,18 +307,14 @@ class TelegramPuppet { } async listen() { - const client = this.client - client.on("update", data => this.handleUpdate(data)) - if (client.bus) { - client.bus.untypedMessage.observe(data => this.handleUpdate(data.message)) - } + this.client.bus.untypedMessage.observe(data => this.handleUpdate(data.message)) try { console.log("Updating online status...") - //const statusUpdate = await client("account.updateStatus", { offline: false }) + //const statusUpdate = await this.client("account.updateStatus", { offline: false }) //console.log(statusUpdate) console.log("Fetching initial state...") - const state = await client("updates.getState", {}) + const state = await this.client("updates.getState", {}) console.log("Initial state:", state) } catch (err) { console.error("Error getting initial state:", err) @@ -348,7 +343,7 @@ class TelegramPuppet { } setInterval(async () => { try { - const state = client("updates.getState", {}) + const state = this.client("updates.getState", {}) // TODO use state? } catch (err) { console.error("Error updating state:", err)