To retrieve the list of messages (without the replies) in a channel of a team using below API:
In "@odata.count" property we can get count of those messages
To get the replies for a message, we need to call the list message replies or the get message reply API.
If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.