Remove useless telegram-mtproto v2 support
This commit is contained in:
@@ -283,7 +283,6 @@ class TelegramPuppet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleUpdate(data) {
|
handleUpdate(data) {
|
||||||
console.log("UPDATE", data)
|
|
||||||
try {
|
try {
|
||||||
switch (data._) {
|
switch (data._) {
|
||||||
case "updateShort":
|
case "updateShort":
|
||||||
@@ -308,18 +307,14 @@ class TelegramPuppet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async listen() {
|
async listen() {
|
||||||
const client = this.client
|
this.client.bus.untypedMessage.observe(data => this.handleUpdate(data.message))
|
||||||
client.on("update", data => this.handleUpdate(data))
|
|
||||||
if (client.bus) {
|
|
||||||
client.bus.untypedMessage.observe(data => this.handleUpdate(data.message))
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log("Updating online status...")
|
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(statusUpdate)
|
||||||
console.log("Fetching initial state...")
|
console.log("Fetching initial state...")
|
||||||
const state = await client("updates.getState", {})
|
const state = await this.client("updates.getState", {})
|
||||||
console.log("Initial state:", state)
|
console.log("Initial state:", state)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error getting initial state:", err)
|
console.error("Error getting initial state:", err)
|
||||||
@@ -348,7 +343,7 @@ class TelegramPuppet {
|
|||||||
}
|
}
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
try {
|
try {
|
||||||
const state = client("updates.getState", {})
|
const state = this.client("updates.getState", {})
|
||||||
// TODO use state?
|
// TODO use state?
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error updating state:", err)
|
console.error("Error updating state:", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user