Improve the chances of logging out not breaking everything
This commit is contained in:
@@ -196,6 +196,7 @@ class TelegramPuppet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
logOut() {
|
logOut() {
|
||||||
|
clearInterval(this.loop)
|
||||||
return this.client("auth.logOut")
|
return this.client("auth.logOut")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -509,7 +510,7 @@ class TelegramPuppet {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Failed to update dialogs:", err)
|
console.error("Failed to update dialogs:", err)
|
||||||
}
|
}
|
||||||
setInterval(async () => {
|
this.loop = setInterval(async () => {
|
||||||
try {
|
try {
|
||||||
await this.client("updates.getState", {})
|
await this.client("updates.getState", {})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user