-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
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
How to listen to new messages on a specific channel? #663
Comments
do somthing like this : import { NewMessage } from 'telegram/events'
const callbackFunction= async (event:any) => {
eventHandler(event); //example function
}
Client.addEventHandler(callbackFunction, new NewMessage({ incoming: true, channels: ['@something' , '@somthing2'] }) )
//if you want to remove the event for some reason
Client.removeEventHandler(callbackFunction) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I looked through all the documentation and didn't find anything like that, I was confused. I just wanted to observe whenever a new message arrived on a Telegram channel so that I could activate automations based on the messages that arrived.
The text was updated successfully, but these errors were encountered: