question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NewMessage event stop getting update

See original GitHub issue

I have 1 account logged in GramJS and Telegram Desktop

on the first start, GramJS was working fine, receiving new update, etc, but after a while and I do some action on Telegram Desktop, NewMessage event stop giving me update, like, there is no update come in…

but, after I use the same TelegramClient for sending message, the NewMessage are working again

my code really as simple as:

async function eventPrint(event) {
  console.log(event)
}
client.addEventHandler(eventPrint, new NewMessage({}));

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
painorcommented, Mar 8, 2022

no, just call it once after connecting.

1reaction
painorcommented, Mar 8, 2022

You need to call a high level request so that telegram knows you want to receive updates. SendMessage is one of those. Another one is client.getMe(). you can call that after you .connect each time

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update Events — Telethon 1.26.1 documentation
Represents the event of a new message. This event can be treated to all effects as a Message , so please refer to...
Read more >
Working with Updates — Telethon 1.7.7 documentation
Methods; Events Without the client; Events Without Decorators; Stopping ... If a NewMessage event occurs, and 'hello' is in the text of the...
Read more >
How to use the telethon.events.NewMessage function ... - Snyk
To help you get started, we've selected a few telethon.events.NewMessage examples, based ... NewMessage) async def echo(update): """Echo the user message.
Read more >
Telethon events.NewMessage() doesn't work - Stack Overflow
How can I get updates for a specific private channel using telethon? 0 · Using telethon to get text from a new message...
Read more >
Bolt for Python - Slack Platform Developer Tools
A framework that makes Slack app development fast and straight-forward. With a single interface for Slack's Web API, Events API, and interactive features, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found