@@ -354,9 +354,37 @@ def sendLocation(self,
354354
355355 return Message .newFromJsonDict (data )
356356
357- def sendChatAction (self ):
357+ def sendChatAction (self ,
358+ chat_id ,
359+ action ):
360+ """Use this method when you need to tell the user that something is
361+ happening on the bot's side. The status is set for 5 seconds or less
362+ (when a message arrives from your bot, Telegram clients clear its
363+ typing status).
364+
365+ Args:
366+ chat_id:
367+ Unique identifier for the message recipient — User or GroupChat id.
368+ action:
369+ Type of action to broadcast. Choose one, depending on what the user
370+ is about to receive:
371+ - ChatAction.TYPING for text messages,
372+ - ChatAction.UPLOAD_PHOTO for photos,
373+ - ChatAction.UPLOAD_VIDEO or upload_video for videos,
374+ - ChatAction.UPLOAD_AUDIO or upload_audio for audio files,
375+ - ChatAction.UPLOAD_DOCUMENT for general files,
376+ - ChatAction.FIND_LOCATION for location data.
377+ Returns:
378+ ?
379+ """
380+
358381 url = '%s/sendChatAction' % (self .base_url )
359382
383+ data = {'chat_id' : chat_id ,
384+ 'action' : action }
385+
386+ self ._requestUrl (url , 'POST' , data = data )
387+
360388 def getUserProfilePhotos (self ):
361389 url = '%s/getUserProfilePhotos' % (self .base_url )
362390
0 commit comments