package messages
- Alphabetic
- Public
- All
Type Members
- final case class DeleteMessage(chatId: ChatId, messageId: Int) extends Product with Serializable
Use this method to delete a message.
Use this method to delete a message.
A message can only be deleted if it was sent less than 48 hours ago. Any such recently sent outgoing message may be deleted.
Additionally, if the bot is an administrator in a group chat, it can delete any message.
If the bot is an administrator in a supergroup, it can delete messages from any other user and service messages about people joining or leaving the group (other types of service messages may only be removed by the group creator).
In channels, bots can only remove their own messages.
Returns True on success.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername).
- messageId
Identifier of the message to delete
- final class EditMessageCaption extends AnyRef
Use this method to edit captions of messages sent by the bot or via the bot (for inline bots).
Use this method to edit captions of messages sent by the bot or via the bot (for inline bots).
On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Use methods in companion object in order to construct the value of this class.
- final class EditMessageLiveLocation extends AnyRef
Use this method to edit live location messages sent by the bot or via the bot (for inline bots).
Use this method to edit live location messages sent by the bot or via the bot (for inline bots). A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation.
Use methods in companion object in order to construct the value of this class.
- final class EditMessageMedia extends AnyRef
Use this method to edit audio, document, photo, or video messages.
Use this method to edit audio, document, photo, or video messages.
If a message is a part of a message album, then it can be edited only to a photo or a video. Otherwise, message type can be changed arbitrarily.
When inline message is edited, new file can't be uploaded. Use previously uploaded file via its file_id or specify a URL.
On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned.
Use methods in companion object in order to construct the value of this class.
- final class EditMessageReplyMarkup extends AnyRef
Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Use methods in companion object in order to construct the value of this class.
- final class EditMessageText extends AnyRef
Use this method to edit text messages sent by the bot or via the bot (for inline bots).
Use this method to edit text messages sent by the bot or via the bot (for inline bots).
On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Use methods in companion object in order to construct the value of this class.
- final case class ForwardMessage(chatId: ChatId, fromChatId: ChatId, messageId: Int, disableNotification: Option[Boolean] = None) extends Product with Serializable
Use this method to forward messages of any kind.
Use this method to forward messages of any kind. On success, the sent Message is returned.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- fromChatId
Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
- messageId
Unique message identifier
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
- final case class SendAnimation(chatId: ChatId, animation: InputFile, duration: Option[Int] = None, width: Option[Int] = None, height: Option[Int] = None, thumb: Option[InputFile] = None, caption: Option[String] = None, parseMode: Option[ParseMode] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- animation
Animation to send
- duration
Duration of sent animation in seconds
- width
Animation width
- height
Animation height
- thumb
Thumbnail of the file sent
- caption
Video caption (may also be used when resending videos by file_id), 0-200 characters
- parseMode
Parse mode of captured text (Markdown or HTML)
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final case class SendAudio(chatId: ChatId, audio: InputFile, duration: Option[Int] = None, caption: Option[String] = None, parseMode: Option[ParseMode] = None, performer: Option[String] = None, title: Option[String] = None, thumb: Option[InputFile] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send audio files, if you want Telegram clients to display them in the music player.
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
For sending voice messages, use the sendVoice method instead.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- audio
Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data.
- duration
Duration of the audio in seconds
- caption
Audio caption, 0-200 characters
- parseMode
Parse mode of captioned text (Markdown or HTML)
- performer
Track performer
- title
Track name
- thumb
Thumbnail of the file sent
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final case class SendContact(chatId: ChatId, phoneNumber: String, firstName: String, lastName: Option[String] = None, vcard: Option[String] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send phone contacts.
Use this method to send phone contacts. On success, the sent Message is returned.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- phoneNumber
Contact's phone number
- firstName
Contact's first name
- lastName
Contact's last name
- vcard
Additional data about the contact in the form of a vCard, 0-2048 bytes
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final case class SendDocument(chatId: ChatId, document: InputFile, thumb: Option[InputFile] = None, caption: Option[String] = None, parseMode: Option[ParseMode] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send general files.
Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- document
File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data.
- thumb
Thumbnail of the file sent
- caption
Audio caption, 0-200 characters
- parseMode
Parse mode of captioned text (Markdown or HTML)
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final case class SendGame(chatId: Long, gameShortName: String, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send a game.
Use this method to send a game.
On success, the sent Message is returned.
- chatId
Unique identifier for the target chat
- gameShortName
Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
- final case class SendInvoice(chatId: Long, title: String, description: String, payload: String, providerToken: String, startParameter: String, currency: Currency, prices: Seq[LabeledPrice], providerData: Option[String] = None, photoUrl: Option[String] = None, photoSize: Option[Int] = None, photoWidth: Option[Int] = None, photoHeight: Option[Int] = None, needName: Option[Boolean] = None, needPhoneNumber: Option[Boolean] = None, needEmail: Option[Boolean] = None, needShippingAddress: Option[Boolean] = None, isFlexible: Option[Boolean] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send invoices.
Use this method to send invoices. On success, the sent Message is returned.
- chatId
Unique identifier for the target private chat
- title
Product name
- description
Product description
- payload
Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
- providerToken
Payments provider token, obtained via Botfather
- startParameter
Unique deep-linking parameter that can be used to generate this invoice when used as a start parameter
- currency
Three-letter ISO 4217 currency code, see more on currencies
- prices
Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
- providerData
JSON-encoded data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
- photoUrl
URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
- photoSize
Photo size
- photoWidth
Photo width
- photoHeight
Photo height
- needName
Pass True, if you require the user's full name to complete the order
- needPhoneNumber
Pass True, if you require the user's phone number to complete the order
- needEmail
Pass True, if you require the user's email to complete the order
- needShippingAddress
Pass True, if you require the user's shipping address to complete the order
- isFlexible
Pass True, if the final price depends on the shipping method
- disableNotification
Sends the message silently. Users will receive a notification with no sound.
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.
- final case class SendLocation(chatId: ChatId, latitude: Double, longitude: Double, livePeriod: Option[Int] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send point on the map.
Use this method to send point on the map. On success, the sent Message is returned.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- latitude
Latitude of location
- longitude
Longitude of location
- livePeriod
Period in seconds for which the location will be updated (see Live Locations). Should be between 60 and 86400.
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final case class SendMediaGroup(chatId: ChatId, media: List[InputMedia], disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None) extends Product with Serializable
Use this method to send a group of photos or videos as an album.
Use this method to send a group of photos or videos as an album. On success, an array of the sent Messages is returned.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- media
List of photos and videos to be sent, must include 2–10 items
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound
- replyToMessageId
If the message is a reply, ID of the original message
- final case class SendMessage(chatId: ChatId, text: String, parseMode: Option[ParseMode] = None, disableWebPagePreview: Option[Boolean] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send text messages.
Use this method to send text messages. On success, the sent Message is returned.
Formatting options
The Bot API supports basic formatting for messages. You can use bold and italic text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can use either markdown-style or HTML-style formatting. Note that Telegram clients will display an alert to the user before opening an inline link ('Open this link?' together with the full URL).
Markdown style
To use this mode, pass Markdown in the parse_mode field when using sendMessage. Use the following syntax in your message: *bold text* _italic text_ [text](URL)
inline fixed-width codepre-formatted fixed-width code blockHTML style
To use this mode, pass HTML in the parse_mode field when using sendMessage. The following tags are currently supported: bold, bold italic, italic inline URL
inline fixed-width codepre-formatted fixed-width code block
Please note:
Only the tags mentioned above are currently supported. Tags must not be nested. All <, > and & symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (< with <, > with > and & with &). All numerical HTML entities are supported. The API currently supports only the following named HTML entities: <, >, & and ".
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- text
Text of the message to be sent
- parseMode
Parse mode of input text (Markdown or HTML)
- disableWebPagePreview
Disables link previews for links in this message
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final case class SendPhoto(chatId: ChatId, photo: InputFile, caption: Option[String] = None, parseMode: Option[ParseMode] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send photos.
Use this method to send photos. On success, the sent Message is returned.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- photo
Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data.
- caption
Photo caption (may also be used when resending photos by file_id), 0-200 characters
- parseMode
Parse mode of captioned text (Markdown or HTML)
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final case class SendPoll(chatId: ChatId, question: String, options: List[String], isAnonymous: Option[Boolean] = None, type: Option[String] = None, allowsMultipleAnswers: Option[Boolean] = None, correctOptionId: Option[Int] = None, isClosed: Option[Boolean] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send a native poll.
Use this method to send a native poll. A native poll can't be sent to a private chat. On success, the sent Message is returned.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- question
Poll question, 1-255 characters
- options
List of answer options, 2-10 strings 1-100 characters each
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final case class SendSticker(chatId: ChatId, sticker: InputFile, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send stickers.
Use this method to send stickers. You can send existing stickers (using file_id), static .WEBP or animated .TGS stickers.
On success, the sent Message is returned.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- sticker
Sticker to send.
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final case class SendVenue(chatId: ChatId, latitude: Double, longitude: Double, title: String, address: String, foursquareId: Option[String] = None, foursquareType: Option[String] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send information about a venue.
Use this method to send information about a venue. On success, the sent Message is returned.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- latitude
Latitude of the venue
- longitude
Longitude of the venue
- title
Name of the venue
- address
Address of the venue
- foursquareId
Foursquare identifier of the venue
- foursquareType
Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final case class SendVideo(chatId: ChatId, video: InputFile, duration: Option[Int] = None, width: Option[Int] = None, height: Option[Int] = None, thumb: Option[InputFile] = None, caption: Option[String] = None, parseMode: Option[ParseMode] = None, supportsStreaming: Option[Boolean] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- video
Video to send
- duration
Duration of sent video in seconds
- width
Video width
- height
Video height
- thumb
Thumbnail of the file sent
- caption
Video caption (may also be used when resending videos by file_id), 0-200 characters
- parseMode
Parse mode of captured text (Markdown or HTML)
- supportsStreaming
Pass True, if the uploaded video is suitable for streaming
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final case class SendVideoNote(chatId: ChatId, videoNote: InputFile, duration: Option[Int] = None, length: Option[Int] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send video messages.
Use this method to send video messages. On success, the sent Message is returned. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- videoNote
Video note to send.
- duration
Duration of sent video in seconds
- length
Video width and height
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final case class SendVoice(chatId: ChatId, voice: InputFile, caption: Option[String] = None, parseMode: Option[ParseMode] = None, duration: Option[Int] = None, disableNotification: Option[Boolean] = None, replyToMessageId: Option[Int] = None, replyMarkup: Option[ReplyMarkup] = None) extends Product with Serializable
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- voice
Audio file to send
- caption
Video caption (may also be used when resending videos by file_id), 0-200 characters
- parseMode
Parse mode of captured text (Markdown or HTML)
- duration
Duration of sent audio in seconds
- disableNotification
Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound
- replyToMessageId
If the message is a reply, ID of the original message
- replyMarkup
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to hide reply keyboard or to force a reply from the user.
- final class StopMessageLiveLocation extends AnyRef
Use this method to stop updating a live location message sent by the bot or via the bot (for inline bots) before live_period expires.
Use this method to stop updating a live location message sent by the bot or via the bot (for inline bots) before live_period expires.
Use methods in companion object in order to construct the value of this class.
- final case class StopPoll(chatId: ChatId, messageId: Int, replyMarkup: Option[InlineKeyboardMarkup] = None) extends Product with Serializable
Use this method to stop a poll which was sent by the bot.
Use this method to stop a poll which was sent by the bot.
On success, the stopped Poll with the final results is returned.
- chatId
Unique identifier for the target chat or username of the target channel (in the format @channelusername).
- messageId
Identifier of the original message with the poll
- replyMarkup
New inline keyboard.
Value Members
- object DeleteMessage extends Serializable
- object EditMessageCaption
- object EditMessageLiveLocation
- object EditMessageMedia
- object EditMessageReplyMarkup
- object EditMessageText
- object ForwardMessage extends Serializable
- object SendAnimation extends Serializable
- object SendAudio extends Serializable
- object SendContact extends Serializable
- object SendDocument extends Serializable
- object SendGame extends Serializable
- object SendInvoice extends Serializable
- object SendLocation extends Serializable
- object SendMediaGroup extends Serializable
- object SendMessage extends Serializable
- object SendPhoto extends Serializable
- object SendPoll extends Serializable
- object SendSticker extends Serializable
- object SendVenue extends Serializable
- object SendVideo extends Serializable
- object SendVideoNote extends Serializable
- object SendVoice extends Serializable
- object StopMessageLiveLocation
- object StopPoll extends Serializable