Method: Telebot::Client#send_chat_action

Defined in:
lib/telebot/client.rb

#send_chat_action(chat_id:, action:) ⇒ void

This method returns an undefined value.

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).

Parameters:

  • chat_id (Integer)
  • action (Symbol)

    :typing, :upload_photo, etc. See CHAT_ACTIONS.



185
186
187
188
# File 'lib/telebot/client.rb', line 185

def send_chat_action(chat_id:, action:)
  fail(ArgumentError, "Unknown chat action `#{action.inspect}`") unless CHAT_ACTIONS.include?(action)
  call(:sendChatAction, chat_id: chat_id, action: action)
end