Hi @Prakash
As your error message indicates, sending messages in chat does not support application-only contexts. So you must grant delegated permissions to your app and use the delegated authentication flow (auth code flow or ROPC flow) to obtain an access token.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.