Hello @Sahi Repswal
Thanks for reaching out!
You can use Change notifications to achieve this use-case. Change Notifications enable you to subscribe to changes (create, update, and delete) to messages in a channel or chat. Whenever, there will be new message in a Teams Channel or chat, notification will be triggered for that and based on the API response, you can automate your process further. Please follow this detailed documentation to know how change notifications works for MS teams resources.
Please note that "The maximum time a Teams subscription can last is 60 minutes; however, subscriptions can be renewed until the caller has permissions to access the resource".
Please do refer these:
[https://github.com/microsoftgraph/microsoft-graph-docs/blob/main/concepts/teams-changenotifications-chatmessage.md
[https://learn.microsoft.com/en-us/graph/webhooks?tabs=http
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.