Notification texts go here Contact Us Buy Now!

sendChatAction: Send A Chat Action In telegram Bot Bots.business

PR Gujju

 Hello, friends welcome to our site technostone.xyz . Today, through this article, we are going to tell you how you can send chat action or set ChatAction in the Telegram bot. With Bots.business.

What Is Chat Action in Telegram

chat action is a feature. What we see in Telegram while doing Daily Telegram. For example, if a user is typing, then below his name above, we see typing. And if someone is sending a photo, then instead of typing, we see the sending photo. It works in all but when we create the boat, we do not see it because we have to set it manually, there are some codes for that which are given below.

This is the code below, it will work only in Telegram bot made on bots.business If you have created your Telegram bot in any other language then you can see Telegram API documents

1: TYPING CHAT ACTION

Api.sendChatAction({ 
chat_id: chat.chatid, 
action: "typing"
})

2: SENDING PHOTO CHAT ACTION

For Sending Photo Chat Action

Api.sendChatAction({ chat_id: chat.chatid, action: "upload_photo" })

3: SENDING VIDEO CHAT ACTION

Api.sendChatAction({ chat_id: chat.chatid, action: "upload_video" })

4: SENDING DOCUMENT CHAT ACTION

For Document Chat Action

Api.sendChatAction({ chat_id: chat.chatid, action: "upload_document" })

5: SENDING AUDIO  CHAT ACTION

Api.sendChatAction({ chat_id: chat.chatid, action: "upload_audio" })
Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
 
There is some other chat action here that you can do.
 
chat_id Unique identifier for the target chat or username of the target channel.
Action
  • typing - For Text Message
  • upload_photo - For sending Photoimage file
  • upload_audio - For Sending Audio File
  • record_audio - For Audio File Recoding
  • upload_video - For Sending Video File
  • record_video - For Video File Recoding
  • upload_document - For Sending Document File
  • find_location - For Sending Location
  • upload_video_note - For Sending Video Note
  • record_video_note - For Video note
This is some ChatAction that you can do to make your telegram bot attractive, I hope you liked this post, if you liked the post, then you can join our youtube family by clicking on the subscribe button below.

https://www.youtube.com/watch?v=Ev3ZcSEpzG4

Getting Info...

About the Author

PR Gujju
Blogger | Youtuber | Beginner Coder

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.