We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I'm having a problem listening for new messages. After a couple of minutes, the addEventHandler method stops working. What could be happening?
This is the code:
`this.client.addEventHandler(this.eventHandler.bind(this), new NewMessage({ chats: CHANNELS_TO_LISTEN }))
private async eventHandler(event: NewMessageEvent) { try { if (!event) { logger.error(The message received is null or undefined) } logger.trace(New message received: ${event.message.message}) this.emit('msg', event.message) } catch (error) { logger.error(Error handling event: ${error}) } } `
The message received is null or undefined
New message received: ${event.message.message}
Error handling event: ${error}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, I'm having a problem listening for new messages. After a couple of minutes, the addEventHandler method stops working. What could be happening?
This is the code:
`this.client.addEventHandler(this.eventHandler.bind(this), new NewMessage({ chats: CHANNELS_TO_LISTEN }))
private async eventHandler(event: NewMessageEvent) {
try {
if (!event) {
logger.error(
The message received is null or undefined
)}
logger.trace(
New message received: ${event.message.message}
)this.emit('msg', event.message)
} catch (error) {
logger.error(
Error handling event: ${error}
)}
}
`
The text was updated successfully, but these errors were encountered: