telegram-api-0.2.1.0: Telegram Bot API bindings

Safe HaskellNone
LanguageHaskell2010

Web.Telegram.API.Bot.Requests

Contents

Description

This module contains data objects which represents requests to Telegram Bot API

Synopsis

Types

data SendMessageRequest Source

This object represents request for sendMessage

Constructors

SendMessageRequest 

Fields

message_chat_id :: Text

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

message_text :: Text

Text of the message to be sent

message_parse_mode :: Maybe ParseMode

Send Markdown, if you want Telegram apps to show bold, italic and inline URLs in your bot's message

message_disable_web_page_preview :: Maybe Bool

Disables link previews for links in this message

message_reply_to_message_id :: Maybe Int

If the message is a reply, ID of the original message

message_reply_markup :: Maybe ReplyKeyboard

Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.

data ForwardMessageRequest Source

This object represents request for forwardMessage

Constructors

ForwardMessageRequest 

Fields

forward_chat_id :: Text

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

forward_from_chat_id :: Text

Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)

forward_mesage_id :: Int

Unique message identifier

data SendPhotoRequest Source

This object represents request for sendPhoto

Constructors

SendPhotoRequest 

Fields

photo_chat_id :: Text

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

photo_photo :: Text

Photo to send. Pass a file_id as String to resend a photo that is already on the Telegram servers

photo_caption :: Maybe Text

Photo caption (may also be used when resending photos by file_id), 0-200 characters.

photo_reply_to_message_id :: Maybe Int

If the message is a reply, ID of the original message

photo_reply_markup :: Maybe ReplyKeyboard

Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.

data SendAudioRequest Source

This object represents request for sendAudio

Constructors

SendAudioRequest 

Fields

_audio_chat_id :: Text

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

_audio_audio :: Text

Audio file to send. Pass a file_id as String to resend an audio that is already on the Telegram servers.

_audio_duration :: Maybe Int

Duration of the audio in seconds

_audio_performer :: Maybe Text

Performer

_audio_title :: Maybe Text

Track name

_audio_reply_to_message_id :: Maybe Int

If the message is a reply, ID of the original message

_audio_reply_markup :: Maybe ReplyKeyboard

Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.

data SendDocumentRequest Source

This object represents request for sendDocument

Constructors

SendDocumentRequest 

Fields

document_chat_id :: Text

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

document_document :: Text

File to send. A file_id as String to resend a file that is already on the Telegram servers

document_reply_to_message_id :: Maybe Int

If the message is a reply, ID of the original message

document_reply_markup :: Maybe ReplyKeyboard

Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.

data SendStickerRequest Source

This object represents request for sendSticker

Constructors

SendStickerRequest 

Fields

sticker_chat_id :: Text

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

sticker_sticker :: Text

Sticker to send. A file_id as String to resend a sticker that is already on the Telegram servers

sticker_reply_to_message_id :: Maybe Int

If the message is a reply, ID of the original message

sticker_reply_markup :: Maybe ReplyKeyboard

Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.

data SendVideoRequest Source

This object represents request for sendVideo

Constructors

SendVideoRequest 

Fields

_video_chat_id :: Text

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

_video_video :: Text

Video to send. A file_id as String to resend a video that is already on the Telegram servers

_video_duration :: Maybe Int

Duration of sent video in seconds

_video_caption :: Maybe Text

Video caption, 0-200 characters.

_video_reply_to_message_id :: Maybe Int

If the message is a reply, ID of the original message

_video_reply_markup :: Maybe ReplyKeyboard

Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.

data SendVoiceRequest Source

This object represents request for sendVoice

Constructors

SendVoiceRequest 

Fields

_voice_chat_id :: Text

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

_voice_voice :: Text

Audio file to send. A file_id as String to resend an audio that is already on the Telegram servers

_voice_duration :: Maybe Int

Duration of sent audio in seconds

_voice_reply_to_message_id :: Maybe Int

If the message is a reply, ID of the original message

_voice_reply_markup :: Maybe ReplyKeyboard

Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.

data SendLocationRequest Source

This object represents request for sendLocation

Constructors

SendLocationRequest 

Fields

location_chat_id :: Text

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

location_latitude :: Float

Latitude of location

location_longitude :: Float

Longitude of location

location_reply_to_message_id :: Maybe Int

If the message is a reply, ID of the original message

location_reply_markup :: Maybe ReplyKeyboard

Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.

data AnswerInlineQueryRequest Source

Constructors

AnswerInlineQueryRequest 

Fields

query_inline_query_id :: Text

Unique identifier for the answered query

query_results :: [InlineQueryResult]

A JSON-serialized array of results for the inline query

query_cache_time :: Maybe Int

The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.

query_is_personal :: Maybe Bool

Pass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query

query_next_offset :: Maybe Text

Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don‘t support pagination. Offset length can’t exceed 64 bytes.

data ReplyKeyboard Source

Constructors

ReplyKeyboardMarkup

This object represents a custom keyboard with reply options

Fields

reply_keyboard :: [[Text]]

Array of button rows, each represented by an Array of Strings

reply_resize_keyboard :: Maybe Bool

Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.

reply_one_time_keyboard :: Maybe Bool

Requests clients to hide the keyboard as soon as it's been used. Defaults to false.

reply_selective :: Maybe Bool

Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user requests to change the bot‘s language, bot replies to the request with a keyboard to select the new language. Other users in the group don’t see the keyboard.

ReplyKeyboardHide

Upon receiving a message with this object, Telegram clients will hide the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button

Fields

reply_hide_keyboard :: Bool

Requests clients to hide the custom keyboard

reply_selective :: Maybe Bool

Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user requests to change the bot‘s language, bot replies to the request with a keyboard to select the new language. Other users in the group don’t see the keyboard.

ForceReply

Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot‘s message and tapped ’Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.

Fields

reply_force_reply :: Bool

Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply'

reply_selective :: Maybe Bool

Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user requests to change the bot‘s language, bot replies to the request with a keyboard to select the new language. Other users in the group don’t see the keyboard.