tdlib-types-0.3.0: src/TDLib/Generated/Types.hs
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE TemplateHaskell #-}
-- | TD API data types generated by tdlib-gen
module TDLib.Generated.Types where
import GHC.Generics
import Language.Haskell.Codegen.TH
import Data.ByteString.Base64.Type
import qualified Data.Text as T
import Language.TL.I64
type I53 = Int
type I32 = Int
type T = T.Text
data Error
= -- | An object of this type can be returned on every function call, in case of an error
Error
{ -- | Error code; subject to future changes. If the error code is 406, the error message must not be processed in any way and must not be displayed to the user
code :: I32,
-- | Error message; subject to future changes
message :: T
}
deriving (Show, Eq, Generic)
data Ok
= -- | An object of this type is returned on a successful function call for certain functions
Ok
{
}
deriving (Show, Eq, Generic)
data TdlibParameters
= -- | Contains parameters for TDLib initialization
TdlibParameters
{ -- | If set to true, the Telegram test environment will be used instead of the production environment
use_test_dc :: Bool,
-- | The path to the directory for the persistent database; if empty, the current working directory will be used
database_directory :: T,
-- | The path to the directory for storing files; if empty, database_directory will be used
files_directory :: T,
-- | If set to true, information about downloaded and uploaded files will be saved between application restarts
use_file_database :: Bool,
-- | If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database
use_chat_info_database :: Bool,
-- | If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database
use_message_database :: Bool,
-- | If set to true, support for secret chats will be enabled
use_secret_chats :: Bool,
-- | Application identifier for Telegram API access, which can be obtained at https://my.telegram.org
api_id :: I32,
-- | Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org
api_hash :: T,
-- | IETF language tag of the user's operating system language; must be non-empty
system_language_code :: T,
-- | Model of the device the application is being run on; must be non-empty
device_model :: T,
-- | Version of the operating system the application is being run on; must be non-empty
system_version :: T,
-- | Application version; must be non-empty
application_version :: T,
-- | If set to true, old files will automatically be deleted
enable_storage_optimizer :: Bool,
-- | If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name
ignore_file_names :: Bool
}
deriving (Show, Eq, Generic)
-- | Provides information about the method by which an authentication code is delivered to the user
data AuthenticationCodeType
= -- | An authentication code is delivered via a private Telegram message, which can be viewed in another client
AuthenticationCodeTypeTelegramMessage
{ -- | Length of the code
length :: I32
}
| -- | An authentication code is delivered via an SMS message to the specified phone number
AuthenticationCodeTypeSms
{ -- | Length of the code
length :: I32
}
| -- | An authentication code is delivered via a phone call to the specified phone number
AuthenticationCodeTypeCall
{ -- | Length of the code
length :: I32
}
| -- | An authentication code is delivered by an immediately cancelled call to the specified phone number. The number from which the call was made is the code
AuthenticationCodeTypeFlashCall
{ -- | Pattern of the phone number from which the call will be made
pattern_ :: T
}
deriving (Show, Eq, Generic)
data AuthenticationCodeInfo
= -- | Information about the authentication code that was sent
AuthenticationCodeInfo
{ -- | A phone number that is being authenticated
phone_number :: T,
-- | Describes the way the code was sent to the user
type_ :: AuthenticationCodeType,
-- | Describes the way the next code will be sent to the user; may be null
next_type :: AuthenticationCodeType,
-- | Timeout before the code should be re-sent, in seconds
timeout :: I32
}
deriving (Show, Eq, Generic)
data EmailAddressAuthenticationCodeInfo
= -- | Information about the email address authentication code that was sent
EmailAddressAuthenticationCodeInfo
{ -- | Pattern of the email address to which an authentication code was sent
email_address_pattern :: T,
-- | Length of the code; 0 if unknown
length :: I32
}
deriving (Show, Eq, Generic)
data TextEntity
= -- | Represents a part of the text that needs to be formatted in some unusual way
TextEntity
{ -- | Offset of the entity in UTF-16 code units
offset :: I32,
-- | Length of the entity, in UTF-16 code units
length :: I32,
-- | Type of the entity
type_ :: TextEntityType
}
deriving (Show, Eq, Generic)
data TextEntities
= -- | Contains a list of text entities
TextEntities
{ -- | List of text entities
entities :: [TextEntity]
}
deriving (Show, Eq, Generic)
data FormattedText
= -- | A text with some entities
FormattedText
{ -- | The text
text :: T,
-- | Entities contained in the text. Entities can be nested, but must not mutually intersect with each other.
entities :: [TextEntity]
}
deriving (Show, Eq, Generic)
data TermsOfService
= -- | Contains Telegram terms of service
TermsOfService
{ -- | Text of the terms of service
text :: FormattedText,
-- | The minimum age of a user to be able to accept the terms; 0 if any
min_user_age :: I32,
-- | True, if a blocking popup with terms of service must be shown to the user
show_popup :: Bool
}
deriving (Show, Eq, Generic)
-- | Represents the current authorization state of the client
data AuthorizationState
= -- | TDLib needs TdlibParameters for initialization
AuthorizationStateWaitTdlibParameters
{
}
| -- | TDLib needs an encryption key to decrypt the local database
AuthorizationStateWaitEncryptionKey
{ -- | True, if the database is currently encrypted
is_encrypted :: Bool
}
| -- | TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options
AuthorizationStateWaitPhoneNumber
{
}
| -- | TDLib needs the user's authentication code to authorize
AuthorizationStateWaitCode
{ -- | Information about the authorization code that was sent
code_info :: AuthenticationCodeInfo
}
| -- | The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link
AuthorizationStateWaitOtherDeviceConfirmation
{ -- | A tg:// URL for the QR code. The link will be updated frequently
link :: T
}
| -- | The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration
AuthorizationStateWaitRegistration
{ -- | Telegram terms of service
terms_of_service :: TermsOfService
}
| -- | The user has been authorized, but needs to enter a password to start using the application
AuthorizationStateWaitPassword
{ -- | Hint for the password; may be empty
password_hint :: T,
-- | True, if a recovery email address has been set up
has_recovery_email_address :: Bool,
-- | Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent
recovery_email_address_pattern :: T
}
| -- | The user has been successfully authorized. TDLib is now ready to answer queries
AuthorizationStateReady
{
}
| -- | The user is currently logging out
AuthorizationStateLoggingOut
{
}
| -- | TDLib is closing, all subsequent queries will be answered with the error 500. Note that closing TDLib can take a while. All resources will be freed only after authorizationStateClosed has been received
AuthorizationStateClosing
{
}
| -- | TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to
AuthorizationStateClosed
{
}
deriving (Show, Eq, Generic)
data PasswordState
= -- | Represents the current state of 2-step verification
PasswordState
{ -- | True, if a 2-step verification password is set
has_password :: Bool,
-- | Hint for the password; may be empty
password_hint :: T,
-- | True, if a recovery email is set
has_recovery_email_address :: Bool,
-- | True, if some Telegram Passport elements were saved
has_passport_data :: Bool,
-- | Information about the recovery email address to which the confirmation email was sent; may be null
recovery_email_address_code_info :: EmailAddressAuthenticationCodeInfo
}
deriving (Show, Eq, Generic)
data RecoveryEmailAddress
= -- | Contains information about the current recovery email address
RecoveryEmailAddress
{ -- | Recovery email address
recovery_email_address :: T
}
deriving (Show, Eq, Generic)
data TemporaryPasswordState
= -- | Returns information about the availability of a temporary password, which can be used for payments
TemporaryPasswordState
{ -- | True, if a temporary password is available
has_password :: Bool,
-- | Time left before the temporary password expires, in seconds
valid_for :: I32
}
deriving (Show, Eq, Generic)
data LocalFile
= -- | Represents a local file
LocalFile
{ -- | Local path to the locally available file part; may be empty
path :: T,
-- | True, if it is possible to try to download or generate the file
can_be_downloaded :: Bool,
-- | True, if the file can be deleted
can_be_deleted :: Bool,
-- | True, if the file is currently being downloaded (or a local copy is being generated by some other means)
is_downloading_active :: Bool,
-- | True, if the local copy is fully available
is_downloading_completed :: Bool,
-- | Download will be started from this offset. downloaded_prefix_size is calculated from this offset
download_offset :: I32,
-- | If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix
downloaded_prefix_size :: I32,
-- | Total downloaded file bytes. Should be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage
downloaded_size :: I32
}
deriving (Show, Eq, Generic)
data RemoteFile
= -- | Represents a remote file
RemoteFile
{ -- | Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers.
id :: T,
-- | Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time
unique_id :: T,
-- | True, if the file is currently being uploaded (or a remote copy is being generated by some other means)
is_uploading_active :: Bool,
-- | True, if a remote copy is fully available
is_uploading_completed :: Bool,
-- | Size of the remote available part of the file; 0 if unknown
uploaded_size :: I32
}
deriving (Show, Eq, Generic)
data File
= -- | Represents a file
File
{ -- | Unique file identifier
id :: I32,
-- | File size; 0 if unknown
size :: I32,
-- | Expected file size in case the exact file size is unknown, but an approximate size is known. Can be used to show download/upload progress
expected_size :: I32,
-- | Information about the local copy of the file
local :: LocalFile,
-- | Information about the remote copy of the file
remote :: RemoteFile
}
deriving (Show, Eq, Generic)
-- | Points to a file
data InputFile
= -- | A file defined by its unique ID
InputFileId
{ -- | Unique file identifier
id_2 :: I32
}
| -- | A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib.
InputFileRemote
{ -- | Remote file identifier
id :: T
}
| -- | A file defined by a local path
InputFileLocal
{ -- | Local path to the file
path :: T
}
| -- | A file generated by the client
InputFileGenerated
{ -- | Local path to a file from which the file is generated; may be empty if there is no such file
original_path :: T,
-- | String specifying the conversion applied to the original file; should be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage
conversion :: T,
-- | Expected size of the generated file; 0 if unknown
expected_size :: I32
}
deriving (Show, Eq, Generic)
data PhotoSize
= -- | Photo description
PhotoSize
{ -- | Thumbnail type (see https://core.telegram.org/constructor/photoSize)
type_ :: T,
-- | Information about the photo file
photo :: File,
-- | Photo width
width :: I32,
-- | Photo height
height :: I32
}
deriving (Show, Eq, Generic)
data Minithumbnail
= -- | Thumbnail image of a very poor quality and low resolution
Minithumbnail
{ -- | Thumbnail width, usually doesn't exceed 40
width :: I32,
-- | Thumbnail height, usually doesn't exceed 40
height :: I32,
-- | The thumbnail in JPEG format
data_ :: ByteString64
}
deriving (Show, Eq, Generic)
-- | Part of the face, relative to which a mask should be placed
data MaskPoint
= -- | A mask should be placed relatively to the forehead
MaskPointForehead
{
}
| -- | A mask should be placed relatively to the eyes
MaskPointEyes
{
}
| -- | A mask should be placed relatively to the mouth
MaskPointMouth
{
}
| -- | A mask should be placed relatively to the chin
MaskPointChin
{
}
deriving (Show, Eq, Generic)
data MaskPosition
= -- | Position on a photo where a mask should be placed
MaskPosition
{ -- | Part of the face, relative to which the mask should be placed
point :: MaskPoint,
-- | Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the mask just to the left of the default mask position)
x_shift :: Double,
-- | Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. (For example, 1.0 will place the mask just below the default mask position)
y_shift :: Double,
-- | Mask scaling coefficient. (For example, 2.0 means a doubled size)
scale :: Double
}
deriving (Show, Eq, Generic)
data PollOption
= -- | Describes one answer option of a poll
PollOption
{ -- | Option text, 1-100 characters
text :: T,
-- | Number of voters for this option, available only for closed or voted polls
voter_count :: I32,
-- | The percentage of votes for this option, 0-100
vote_percentage :: I32,
-- | True, if the option was chosen by the user
is_chosen :: Bool,
-- | True, if the option is being chosen by a pending setPollAnswer request
is_being_chosen :: Bool
}
deriving (Show, Eq, Generic)
-- | Describes the type of a poll
data PollType
= -- | A regular poll
PollTypeRegular
{ -- | True, if multiple answer options can be chosen simultaneously
allow_multiple_answers :: Bool
}
| -- | A poll in quiz mode, which has exactly one correct answer option and can be answered only once
PollTypeQuiz
{ -- | 0-based identifier of the correct answer option; -1 for a yet unanswered poll
correct_option_id :: I32,
-- | Text that is shown when the user chooses an incorrect answer or taps on the lamp icon, 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll
explanation :: FormattedText
}
deriving (Show, Eq, Generic)
data Animation
= -- | Describes an animation file. The animation must be encoded in GIF or MPEG4 format
Animation
{ -- | Duration of the animation, in seconds; as defined by the sender
duration :: I32,
-- | Width of the animation
width :: I32,
-- | Height of the animation
height :: I32,
-- | Original name of the file; as defined by the sender
file_name :: T,
-- | MIME type of the file, usually "image/gif" or "video/mp4"
mime_type :: T,
-- | Animation minithumbnail; may be null
minithumbnail :: Minithumbnail,
-- | Animation thumbnail; may be null
thumbnail :: PhotoSize,
-- | File containing the animation
animation :: File
}
deriving (Show, Eq, Generic)
data Audio
= -- | Describes an audio file. Audio is usually in MP3 or M4A format
Audio
{ -- | Duration of the audio, in seconds; as defined by the sender
duration :: I32,
-- | Title of the audio; as defined by the sender
title :: T,
-- | Performer of the audio; as defined by the sender
performer :: T,
-- | Original name of the file; as defined by the sender
file_name :: T,
-- | The MIME type of the file; as defined by the sender
mime_type :: T,
-- | The minithumbnail of the album cover; may be null
album_cover_minithumbnail :: Minithumbnail,
-- | The thumbnail of the album cover; as defined by the sender. The full size thumbnail should be extracted from the downloaded file; may be null
album_cover_thumbnail :: PhotoSize,
-- | File containing the audio
audio :: File
}
deriving (Show, Eq, Generic)
data Document
= -- | Describes a document of any type
Document
{ -- | Original name of the file; as defined by the sender
file_name :: T,
-- | MIME type of the file; as defined by the sender
mime_type :: T,
-- | Document minithumbnail; may be null
minithumbnail :: Minithumbnail,
-- | Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null
thumbnail :: PhotoSize,
-- | File containing the document
document :: File
}
deriving (Show, Eq, Generic)
data Photo
= -- | Describes a photo
Photo
{ -- | True, if stickers were added to the photo
has_stickers :: Bool,
-- | Photo minithumbnail; may be null
minithumbnail :: Minithumbnail,
-- | Available variants of the photo, in different sizes
sizes :: [PhotoSize]
}
deriving (Show, Eq, Generic)
data Sticker
= -- | Describes a sticker
Sticker
{ -- | The identifier of the sticker set to which the sticker belongs; 0 if none
set_id :: I64,
-- | Sticker width; as defined by the sender
width :: I32,
-- | Sticker height; as defined by the sender
height :: I32,
-- | Emoji corresponding to the sticker
emoji :: T,
-- | True, if the sticker is an animated sticker in TGS format
is_animated :: Bool,
-- | True, if the sticker is a mask
is_mask :: Bool,
-- | Position where the mask should be placed; may be null
mask_position :: MaskPosition,
-- | Sticker thumbnail in WEBP or JPEG format; may be null
thumbnail :: PhotoSize,
-- | File containing the sticker
sticker :: File
}
deriving (Show, Eq, Generic)
data Video
= -- | Describes a video file
Video
{ -- | Duration of the video, in seconds; as defined by the sender
duration :: I32,
-- | Video width; as defined by the sender
width :: I32,
-- | Video height; as defined by the sender
height :: I32,
-- | Original name of the file; as defined by the sender
file_name :: T,
-- | MIME type of the file; as defined by the sender
mime_type :: T,
-- | True, if stickers were added to the video
has_stickers :: Bool,
-- | True, if the video should be tried to be streamed
supports_streaming :: Bool,
-- | Video minithumbnail; may be null
minithumbnail :: Minithumbnail,
-- | Video thumbnail; as defined by the sender; may be null
thumbnail :: PhotoSize,
-- | File containing the video
video :: File
}
deriving (Show, Eq, Generic)
data VideoNote
= -- | Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format
VideoNote
{ -- | Duration of the video, in seconds; as defined by the sender
duration :: I32,
-- | Video width and height; as defined by the sender
length :: I32,
-- | Video minithumbnail; may be null
minithumbnail :: Minithumbnail,
-- | Video thumbnail; as defined by the sender; may be null
thumbnail :: PhotoSize,
-- | File containing the video
video :: File
}
deriving (Show, Eq, Generic)
data VoiceNote
= -- | Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel
VoiceNote
{ -- | Duration of the voice note, in seconds; as defined by the sender
duration :: I32,
-- | A waveform representation of the voice note in 5-bit format
waveform :: ByteString64,
-- | MIME type of the file; as defined by the sender
mime_type :: T,
-- | File containing the voice note
voice :: File
}
deriving (Show, Eq, Generic)
data Contact
= -- | Describes a user contact
Contact
{ -- | Phone number of the user
phone_number :: T,
-- | First name of the user; 1-255 characters in length
first_name :: T,
-- | Last name of the user
last_name :: T,
-- | Additional data about the user in a form of vCard; 0-2048 bytes in length
vcard :: T,
-- | Identifier of the user, if known; otherwise 0
user_id :: I32
}
deriving (Show, Eq, Generic)
data Location
= -- | Describes a location on planet Earth
Location
{ -- | Latitude of the location in degrees; as defined by the sender
latitude :: Double,
-- | Longitude of the location, in degrees; as defined by the sender
longitude :: Double
}
deriving (Show, Eq, Generic)
data Venue
= -- | Describes a venue
Venue
{ -- | Venue location; as defined by the sender
location :: Location,
-- | Venue name; as defined by the sender
title :: T,
-- | Venue address; as defined by the sender
address :: T,
-- | Provider of the venue database; as defined by the sender. Currently only "foursquare" needs to be supported
provider :: T,
-- | Identifier of the venue in the provider database; as defined by the sender
id :: T,
-- | Type of the venue in the provider database; as defined by the sender
type_ :: T
}
deriving (Show, Eq, Generic)
data Game
= -- | Describes a game
Game
{ -- | Game ID
id :: I64,
-- | Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name}
short_name :: T,
-- | Game title
title :: T,
-- | Game text, usually containing scoreboards for a game
text :: FormattedText,
-- | Describes a game
description :: T,
-- | Game photo
photo :: Photo,
-- | Game animation; may be null
animation :: Animation
}
deriving (Show, Eq, Generic)
data Poll
= -- | Describes a poll
Poll
{ -- | Unique poll identifier
id :: I64,
-- | Poll question, 1-255 characters
question :: T,
-- | List of poll answer options
options :: [PollOption],
-- | Total number of voters, participating in the poll
total_voter_count :: I32,
-- | User identifiers of recent voters, if the poll is non-anonymous
recent_voter_user_ids :: [I32],
-- | True, if the poll is anonymous
is_anonymous :: Bool,
-- | Type of the poll
type_ :: PollType,
-- | Amount of time the poll will be active after creation, in seconds
open_period :: I32,
-- | Point in time (Unix timestamp) when the poll will be automatically closed
close_date :: I32,
-- | True, if the poll is closed
is_closed :: Bool
}
deriving (Show, Eq, Generic)
data ProfilePhoto
= -- | Describes a user profile photo
ProfilePhoto
{ -- | Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of userProfilePhotos
id :: I64,
-- | A small (160x160) user profile photo. The file can be downloaded only before the photo is changed
small :: File,
-- | A big (640x640) user profile photo. The file can be downloaded only before the photo is changed
big :: File
}
deriving (Show, Eq, Generic)
data ChatPhoto
= -- | Describes the photo of a chat
ChatPhoto
{ -- | A small (160x160) chat photo. The file can be downloaded only before the photo is changed
small :: File,
-- | A big (640x640) chat photo. The file can be downloaded only before the photo is changed
big :: File
}
deriving (Show, Eq, Generic)
-- | Represents the type of a user. The following types are possible: regular users, deleted users and bots
data UserType
= -- | A regular user
UserTypeRegular
{
}
| -- | A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user
UserTypeDeleted
{
}
| -- | A bot (see https://core.telegram.org/bots)
UserTypeBot
{ -- | True, if the bot can be invited to basic group and supergroup chats
can_join_groups :: Bool,
-- | True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages
can_read_all_group_messages :: Bool,
-- | True, if the bot supports inline queries
is_inline :: Bool,
-- | Placeholder for inline queries (displayed on the client input field)
inline_query_placeholder :: T,
-- | True, if the location of the user should be sent with every inline query to this bot
need_location :: Bool
}
| -- | No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type
UserTypeUnknown
{
}
deriving (Show, Eq, Generic)
data BotCommand
= -- | Represents a command supported by a bot
BotCommand
{ -- | Text of the bot command
command :: T,
-- | Represents a command supported by a bot
description :: T
}
deriving (Show, Eq, Generic)
data BotInfo
= -- | Provides information about a bot and its supported commands
BotInfo
{ -- | Provides information about a bot and its supported commands
description :: T,
-- | A list of commands supported by the bot
commands :: [BotCommand]
}
deriving (Show, Eq, Generic)
data ChatLocation
= -- | Represents a location to which a chat is connected
ChatLocation
{ -- | The location
location :: Location,
-- | Location address; 1-64 characters, as defined by the chat owner
address :: T
}
deriving (Show, Eq, Generic)
data User
= -- | Represents a user
User
{ -- | User identifier
id :: I32,
-- | First name of the user
first_name :: T,
-- | Last name of the user
last_name :: T,
-- | Username of the user
username :: T,
-- | Phone number of the user
phone_number :: T,
-- | Current online status of the user
status :: UserStatus,
-- | Profile photo of the user; may be null
profile_photo :: ProfilePhoto,
-- | The user is a contact of the current user
is_contact :: Bool,
-- | The user is a contact of the current user and the current user is a contact of the user
is_mutual_contact :: Bool,
-- | True, if the user is verified
is_verified :: Bool,
-- | True, if the user is Telegram support account
is_support :: Bool,
-- | If non-empty, it contains a human-readable description of the reason why access to this user must be restricted
restriction_reason :: T,
-- | True, if many users reported this user as a scam
is_scam :: Bool,
-- | If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser
have_access :: Bool,
-- | Type of the user
type_ :: UserType,
-- | IETF language tag of the user's language; only available to bots
language_code :: T
}
deriving (Show, Eq, Generic)
data UserFullInfo
= -- | Contains full information about a user (except the full list of profile photos)
UserFullInfo
{ -- | True, if the user is blacklisted by the current user
is_blocked :: Bool,
-- | True, if the user can be called
can_be_called :: Bool,
-- | True, if the user can't be called due to their privacy settings
has_private_calls :: Bool,
-- | True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used
need_phone_number_privacy_exception :: Bool,
-- | A short user bio
bio :: T,
-- | For bots, the text that is included with the link when users share the bot
share_text :: T,
-- | Number of group chats where both the other user and the current user are a member; 0 for the current user
group_in_common_count :: I32,
-- | If the user is a bot, information about the bot; may be null
bot_info :: BotInfo
}
deriving (Show, Eq, Generic)
data UserProfilePhoto
= -- | Contains full information about a user profile photo
UserProfilePhoto
{ -- | Unique user profile photo identifier
id :: I64,
-- | Point in time (Unix timestamp) when the photo has been added
added_date :: I32,
-- | Available variants of the user photo, in different sizes
sizes :: [PhotoSize]
}
deriving (Show, Eq, Generic)
data UserProfilePhotos
= -- | Contains part of the list of user photos
UserProfilePhotos
{ -- | Total number of user profile photos
total_count :: I32,
-- | A list of photos
photos :: [UserProfilePhoto]
}
deriving (Show, Eq, Generic)
data Users
= -- | Represents a list of users
Users
{ -- | Approximate total count of users found
total_count :: I32,
-- | A list of user identifiers
user_ids :: [I32]
}
deriving (Show, Eq, Generic)
data ChatAdministrator
= -- | Contains information about a chat administrator
ChatAdministrator
{ -- | User identifier of the administrator
user_id :: I32,
-- | Custom title of the administrator
custom_title :: T,
-- | True, if the user is the owner of the chat
is_owner :: Bool
}
deriving (Show, Eq, Generic)
data ChatAdministrators
= -- | Represents a list of chat administrators
ChatAdministrators
{ -- | A list of chat administrators
administrators :: [ChatAdministrator]
}
deriving (Show, Eq, Generic)
data ChatPermissions
= -- | Describes actions that a user is allowed to take in a chat
ChatPermissions
{ -- | True, if the user can send text messages, contacts, locations, and venues
can_send_messages :: Bool,
-- | True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions
can_send_media_messages :: Bool,
-- | True, if the user can send polls. Implies can_send_messages permissions
can_send_polls :: Bool,
-- | True, if the user can send animations, games, and stickers and use inline bots. Implies can_send_messages permissions
can_send_other_messages :: Bool,
-- | True, if the user may add a web page preview to their messages. Implies can_send_messages permissions
can_add_web_page_previews :: Bool,
-- | True, if the user can change the chat title, photo, and other settings
can_change_info :: Bool,
-- | True, if the user can invite new users to the chat
can_invite_users :: Bool,
-- | True, if the user can pin messages
can_pin_messages :: Bool
}
deriving (Show, Eq, Generic)
-- | Provides information about the status of a member in a chat
data ChatMemberStatus
= -- | The user is the owner of a chat and has all the administrator privileges
ChatMemberStatusCreator
{ -- | A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only
custom_title :: T,
-- | True, if the user is a member of the chat
is_member :: Bool
}
| -- | The user is a member of a chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, and ban unprivileged members. In supergroups and channels, there are more detailed options for administrator privileges
ChatMemberStatusAdministrator
{ -- | A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only
custom_title :: T,
-- | True, if the current user can edit the administrator privileges for the called user
can_be_edited :: Bool,
-- | True, if the administrator can change the chat title, photo, and other settings
can_change_info :: Bool,
-- | True, if the administrator can create channel posts; applicable to channels only
can_post_messages :: Bool,
-- | True, if the administrator can edit messages of other users and pin messages; applicable to channels only
can_edit_messages :: Bool,
-- | True, if the administrator can delete messages of other users
can_delete_messages :: Bool,
-- | True, if the administrator can invite new users to the chat
can_invite_users :: Bool,
-- | True, if the administrator can restrict, ban, or unban chat members
can_restrict_members :: Bool,
-- | True, if the administrator can pin messages; applicable to groups only
can_pin_messages :: Bool,
-- | True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them
can_promote_members :: Bool
}
| -- | The user is a member of a chat, without any additional privileges or restrictions
ChatMemberStatusMember
{
}
| -- | The user is under certain restrictions in the chat. Not supported in basic groups and channels
ChatMemberStatusRestricted
{ -- | True, if the user is a member of the chat
is_member :: Bool,
-- | Point in time (Unix timestamp) when restrictions will be lifted from the user; 0 if never. If the user is restricted for more than 366 days or for less than 30 seconds from the current time, the user is considered to be restricted forever
restricted_until_date :: I32,
-- | User permissions in the chat
permissions :: ChatPermissions
}
| -- | The user is not a chat member
ChatMemberStatusLeft
{
}
| -- | The user was banned (and hence is not a member of the chat). Implies the user can't return to the chat or view messages
ChatMemberStatusBanned
{ -- | Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever
banned_until_date :: I32
}
deriving (Show, Eq, Generic)
data ChatMember
= -- | A user with information about joining/leaving a chat
ChatMember
{ -- | User identifier of the chat member
user_id :: I32,
-- | Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown
inviter_user_id :: I32,
-- | Point in time (Unix timestamp) when the user joined a chat
joined_chat_date :: I32,
-- | Status of the member in the chat
status :: ChatMemberStatus,
-- | If the user is a bot, information about the bot; may be null. Can be null even for a bot if the bot is not a chat member
bot_info :: BotInfo
}
deriving (Show, Eq, Generic)
data ChatMembers
= -- | Contains a list of chat members
ChatMembers
{ -- | Approximate total count of chat members found
total_count :: I32,
-- | A list of chat members
members :: [ChatMember]
}
deriving (Show, Eq, Generic)
-- | Specifies the kind of chat members to return in searchChatMembers
data ChatMembersFilter
= -- | Returns contacts of the user
ChatMembersFilterContacts
{
}
| -- | Returns the owner and administrators
ChatMembersFilterAdministrators
{
}
| -- | Returns all chat members, including restricted chat members
ChatMembersFilterMembers
{
}
| -- | Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup
ChatMembersFilterRestricted
{
}
| -- | Returns users banned from the chat; can be used only by administrators in a supergroup or in a channel
ChatMembersFilterBanned
{
}
| -- | Returns bot members of the chat
ChatMembersFilterBots
{
}
deriving (Show, Eq, Generic)
-- | Specifies the kind of chat members to return in getSupergroupMembers
data SupergroupMembersFilter
= -- | Returns recently active users in reverse chronological order
SupergroupMembersFilterRecent
{
}
| -- | Returns contacts of the user, which are members of the supergroup or channel
SupergroupMembersFilterContacts
{ -- | Query to search for
query :: T
}
| -- | Returns the owner and administrators
SupergroupMembersFilterAdministrators
{
}
| -- | Used to search for supergroup or channel members via a (string) query
SupergroupMembersFilterSearch
{ -- | Query to search for
query :: T
}
| -- | Returns restricted supergroup members; can be used only by administrators
SupergroupMembersFilterRestricted
{ -- | Query to search for
query :: T
}
| -- | Returns users banned from the supergroup or channel; can be used only by administrators
SupergroupMembersFilterBanned
{ -- | Query to search for
query :: T
}
| -- | Returns bot members of the supergroup or channel
SupergroupMembersFilterBots
{
}
deriving (Show, Eq, Generic)
data BasicGroup
= -- | Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users)
BasicGroup
{ -- | Group identifier
id :: I32,
-- | Number of members in the group
member_count :: I32,
-- | Status of the current user in the group
status :: ChatMemberStatus,
-- | True, if the group is active
is_active :: Bool,
-- | Identifier of the supergroup to which this group was upgraded; 0 if none
upgraded_to_supergroup_id :: I32
}
deriving (Show, Eq, Generic)
data BasicGroupFullInfo
= -- | Contains full information about a basic group
BasicGroupFullInfo
{ -- | Contains full information about a basic group
description :: T,
-- | User identifier of the creator of the group; 0 if unknown
creator_user_id :: I32,
-- | Group members
members :: [ChatMember],
-- | Invite link for this group; available only after it has been generated at least once and only for the group creator
invite_link :: T
}
deriving (Show, Eq, Generic)
data Supergroup
= -- | Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup: only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos. Unlike supergroups, channels can have an unlimited number of subscribers
Supergroup
{ -- | Supergroup or channel identifier
id :: I32,
-- | Username of the supergroup or channel; empty for private supergroups or channels
username :: T,
-- | Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member
date :: I32,
-- | Status of the current user in the supergroup or channel; custom title will be always empty
status :: ChatMemberStatus,
-- | Number of members in the supergroup or channel; 0 if unknown. Currently it is guaranteed to be known only if the supergroup or channel was found through SearchPublicChats
member_count :: I32,
-- | True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel
has_linked_chat :: Bool,
-- | True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup
has_location :: Bool,
-- | True, if messages sent to the channel should contain information about the sender. This field is only applicable to channels
sign_messages :: Bool,
-- | True, if the slow mode is enabled in the supergroup
is_slow_mode_enabled :: Bool,
-- | True, if the supergroup is a channel
is_channel :: Bool,
-- | True, if the supergroup or channel is verified
is_verified :: Bool,
-- | If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted
restriction_reason :: T,
-- | True, if many users reported this supergroup as a scam
is_scam :: Bool
}
deriving (Show, Eq, Generic)
data SupergroupFullInfo
= -- | Contains full information about a supergroup or channel
SupergroupFullInfo
{ -- | Contains full information about a supergroup or channel
description :: T,
-- | Number of members in the supergroup or channel; 0 if unknown
member_count :: I32,
-- | Number of privileged users in the supergroup or channel; 0 if unknown
administrator_count :: I32,
-- | Number of restricted users in the supergroup; 0 if unknown
restricted_count :: I32,
-- | Number of users banned from chat; 0 if unknown
banned_count :: I32,
-- | Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown
linked_chat_id :: I53,
-- | Delay between consecutive sent messages for non-administrator supergroup members, in seconds
slow_mode_delay :: I32,
-- | Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero
slow_mode_delay_expires_in :: Double,
-- | True, if members of the chat can be retrieved
can_get_members :: Bool,
-- | True, if the chat username can be changed
can_set_username :: Bool,
-- | True, if the supergroup sticker set can be changed
can_set_sticker_set :: Bool,
-- | True, if the supergroup location can be changed
can_set_location :: Bool,
-- | True, if the channel statistics is available
can_view_statistics :: Bool,
-- | True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators
is_all_history_available :: Bool,
-- | Identifier of the supergroup sticker set; 0 if none
sticker_set_id :: I64,
-- | Location to which the supergroup is connected; may be null
location :: ChatLocation,
-- | Invite link for this chat
invite_link :: T,
-- | Identifier of the basic group from which supergroup was upgraded; 0 if none
upgraded_from_basic_group_id :: I32,
-- | Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none
upgraded_from_max_message_id :: I53
}
deriving (Show, Eq, Generic)
-- | Describes the current secret chat state
data SecretChatState
= -- | The secret chat is not yet created; waiting for the other user to get online
SecretChatStatePending
{
}
| -- | The secret chat is ready to use
SecretChatStateReady
{
}
| -- | The secret chat is closed
SecretChatStateClosed
{
}
deriving (Show, Eq, Generic)
data SecretChat
= -- | Represents a secret chat
SecretChat
{ -- | Secret chat identifier
id :: I32,
-- | Identifier of the chat partner
user_id :: I32,
-- | State of the secret chat
state :: SecretChatState,
-- | True, if the chat was created by the current user; otherwise false
is_outbound :: Bool,
-- | Current message Time To Live setting (self-destruct timer) for the chat, in seconds
ttl :: I32,
-- | Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9.
key_hash :: ByteString64,
-- | Secret chat layer; determines features supported by the other client. Video notes are supported if the layer >= 66; nested text entities and underline and strikethrough entities are supported if the layer >= 101
layer :: I32
}
deriving (Show, Eq, Generic)
-- | Contains information about the origin of a forwarded message
data MessageForwardOrigin
= -- | The message was originally written by a known user
MessageForwardOriginUser
{ -- | Identifier of the user that originally sent the message
sender_user_id :: I32
}
| -- | The message was originally written by a user, which is hidden by their privacy settings
MessageForwardOriginHiddenUser
{ -- | Name of the sender
sender_name :: T
}
| -- | The message was originally a post in a channel
MessageForwardOriginChannel
{ -- | Identifier of the chat from which the message was originally forwarded
chat_id :: I53,
-- | Message identifier of the original message; 0 if unknown
message_id :: I53,
-- | Original post author signature
author_signature :: T
}
deriving (Show, Eq, Generic)
data MessageForwardInfo
= -- | Contains information about a forwarded message
MessageForwardInfo
{ -- | Origin of a forwarded message
origin :: MessageForwardOrigin,
-- | Point in time (Unix timestamp) when the message was originally sent
date :: I32,
-- | The type of a public service announcement for the forwarded message
public_service_announcement_type :: T,
-- | For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown
from_chat_id :: I53,
-- | For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown
from_message_id :: I53
}
deriving (Show, Eq, Generic)
-- | Contains information about the sending state of the message
data MessageSendingState
= -- | The message is being sent now, but has not yet been delivered to the server
MessageSendingStatePending
{
}
| -- | The message failed to be sent
MessageSendingStateFailed
{ -- | An error code; 0 if unknown
error_code :: I32,
-- | Error message
error_message :: T,
-- | True, if the message can be re-sent
can_retry :: Bool,
-- | Time left before the message can be re-sent, in seconds. No update is sent when this field changes
retry_after :: Double
}
deriving (Show, Eq, Generic)
data Message
= -- | Describes a message
Message
{ -- | Message identifier, unique for the chat to which the message belongs
id :: I53,
-- | Identifier of the user who sent the message; 0 if unknown. Currently, it is unknown for channel posts and for channel posts automatically forwarded to discussion group
sender_user_id :: I32,
-- | Chat identifier
chat_id :: I53,
-- | Information about the sending state of the message; may be null
sending_state :: MessageSendingState,
-- | Information about the scheduling state of the message; may be null
scheduling_state :: MessageSchedulingState,
-- | True, if the message is outgoing
is_outgoing :: Bool,
-- | True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the client
can_be_edited :: Bool,
-- | True, if the message can be forwarded
can_be_forwarded :: Bool,
-- | True, if the message can be deleted only for the current user while other users will continue to see it
can_be_deleted_only_for_self :: Bool,
-- | True, if the message can be deleted for all users
can_be_deleted_for_all_users :: Bool,
-- | True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts
is_channel_post :: Bool,
-- | True, if the message contains an unread mention for the current user
contains_unread_mention :: Bool,
-- | Point in time (Unix timestamp) when the message was sent
date :: I32,
-- | Point in time (Unix timestamp) when the message was last edited
edit_date :: I32,
-- | Information about the initial message sender; may be null
forward_info :: MessageForwardInfo,
-- | If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message
reply_to_message_id :: I53,
-- | For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires
ttl :: I32,
-- | Time left before the message expires, in seconds
ttl_expires_in :: Double,
-- | If non-zero, the user identifier of the bot through which this message was sent
via_bot_user_id :: I32,
-- | For channel posts, optional author signature
author_signature :: T,
-- | Number of times this message was viewed
views :: I32,
-- | Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums
media_album_id :: I64,
-- | If non-empty, contains a human-readable description of the reason why access to this message must be restricted
restriction_reason :: T,
-- | Content of the message
content :: MessageContent,
-- | Reply markup for the message; may be null
reply_markup :: ReplyMarkup
}
deriving (Show, Eq, Generic)
data Messages
= -- | Contains a list of messages
Messages
{ -- | Approximate total count of messages found
total_count :: I32,
-- | List of messages; messages may be null
messages :: [Message]
}
deriving (Show, Eq, Generic)
data FoundMessages
= -- | Contains a list of messages found by a search
FoundMessages
{ -- | List of messages
messages :: [Message],
-- | Value to pass as from_search_id to get more results
next_from_search_id :: I64
}
deriving (Show, Eq, Generic)
-- | Describes the types of chats to which notification settings are applied
data NotificationSettingsScope
= -- | Notification settings applied to all private and secret chats when the corresponding chat setting has a default value
NotificationSettingsScopePrivateChats
{
}
| -- | Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value
NotificationSettingsScopeGroupChats
{
}
| -- | Notification settings applied to all channels when the corresponding chat setting has a default value
NotificationSettingsScopeChannelChats
{
}
deriving (Show, Eq, Generic)
data ChatNotificationSettings
= -- | Contains information about notification settings for a chat
ChatNotificationSettings
{ -- | If true, mute_for is ignored and the value for the relevant type of chat is used instead
use_default_mute_for :: Bool,
-- | Time left before notifications will be unmuted, in seconds
mute_for :: I32,
-- | If true, sound is ignored and the value for the relevant type of chat is used instead
use_default_sound :: Bool,
-- | The name of an audio file to be used for notification sounds; only applies to iOS applications
sound :: T,
-- | If true, show_preview is ignored and the value for the relevant type of chat is used instead
use_default_show_preview :: Bool,
-- | True, if message content should be displayed in notifications
show_preview :: Bool,
-- | If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead
use_default_disable_pinned_message_notifications :: Bool,
-- | If true, notifications for incoming pinned messages will be created as for an ordinary unread message
disable_pinned_message_notifications :: Bool,
-- | If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead
use_default_disable_mention_notifications :: Bool,
-- | If true, notifications for messages with mentions will be created as for an ordinary unread message
disable_mention_notifications :: Bool
}
deriving (Show, Eq, Generic)
data ScopeNotificationSettings
= -- | Contains information about notification settings for several chats
ScopeNotificationSettings
{ -- | Time left before notifications will be unmuted, in seconds
mute_for :: I32,
-- | The name of an audio file to be used for notification sounds; only applies to iOS applications
sound :: T,
-- | True, if message content should be displayed in notifications
show_preview :: Bool,
-- | True, if notifications for incoming pinned messages will be created as for an ordinary unread message
disable_pinned_message_notifications :: Bool,
-- | True, if notifications for messages with mentions will be created as for an ordinary unread message
disable_mention_notifications :: Bool
}
deriving (Show, Eq, Generic)
data DraftMessage
= -- | Contains information about a message draft
DraftMessage
{ -- | Identifier of the message to reply to; 0 if none
reply_to_message_id :: I53,
-- | Point in time (Unix timestamp) when the draft was created
date :: I32,
-- | Content of the message draft; this should always be of type inputMessageText
input_message_text :: InputMessageContent
}
deriving (Show, Eq, Generic)
-- | Describes the type of a chat
data ChatType
= -- | An ordinary chat with a user
ChatTypePrivate
{ -- | User identifier
user_id :: I32
}
| -- | A basic group (i.e., a chat with 0-200 other users)
ChatTypeBasicGroup
{ -- | Basic group identifier
basic_group_id :: I32
}
| -- | A supergroup (i.e. a chat with up to GetOption("supergroup_max_size") other users), or channel (with unlimited members)
ChatTypeSupergroup
{ -- | Supergroup or channel identifier
supergroup_id :: I32,
-- | True, if the supergroup is a channel
is_channel :: Bool
}
| -- | A secret chat with a user
ChatTypeSecret
{ -- | Secret chat identifier
secret_chat_id :: I32,
-- | User identifier of the secret chat peer
user_id :: I32
}
deriving (Show, Eq, Generic)
-- | Describes a list of chats
data ChatList
= -- | A main list of chats
ChatListMain
{
}
| -- | A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives
ChatListArchive
{
}
deriving (Show, Eq, Generic)
-- | Describes a reason why the chat is shown in a chat list
data ChatSource
= -- | The chat is sponsored by the user's MTProxy server
ChatSourceMtprotoProxy
{
}
| -- | The chat contains a public service announcement
ChatSourcePublicServiceAnnouncement
{ -- | The type of the announcement
type_ :: T,
-- | The text of the announcement
text :: T
}
deriving (Show, Eq, Generic)
data Chat
= -- | A chat. (Can be a private chat, basic group, supergroup, or secret chat)
Chat
{ -- | Chat unique identifier
id :: I53,
-- | Type of the chat
type_ :: ChatType,
-- | A chat list to which the chat belongs; may be null
chat_list :: ChatList,
-- | Chat title
title :: T,
-- | Chat photo; may be null
photo :: ChatPhoto,
-- | Actions that non-administrator chat members are allowed to take in the chat
permissions :: ChatPermissions,
-- | Last message in the chat; may be null
last_message :: Message,
-- | Descending parameter by which chats are sorted in the main chat list. If the order number of two chats is the same, they must be sorted in descending order by ID. If 0, the position of the chat in the list is undetermined
order :: I64,
-- | Source of the chat in a chat list; may be null
source :: ChatSource,
-- | True, if the chat is pinned
is_pinned :: Bool,
-- | True, if the chat is marked as unread
is_marked_as_unread :: Bool,
-- | True, if the chat has scheduled messages
has_scheduled_messages :: Bool,
-- | True, if the chat messages can be deleted only for the current user while other users will continue to see the messages
can_be_deleted_only_for_self :: Bool,
-- | True, if the chat messages can be deleted for all users
can_be_deleted_for_all_users :: Bool,
-- | True, if the chat can be reported to Telegram moderators through reportChat
can_be_reported :: Bool,
-- | Default value of the disable_notification parameter, used when a message is sent to the chat
default_disable_notification :: Bool,
-- | Number of unread messages in the chat
unread_count :: I32,
-- | Identifier of the last read incoming message
last_read_inbox_message_id :: I53,
-- | Identifier of the last read outgoing message
last_read_outbox_message_id :: I53,
-- | Number of unread messages with a mention/reply in the chat
unread_mention_count :: I32,
-- | Notification settings for this chat
notification_settings :: ChatNotificationSettings,
-- | Describes actions which should be possible to do through a chat action bar; may be null
action_bar :: ChatActionBar,
-- | Identifier of the pinned message in the chat; 0 if none
pinned_message_id :: I53,
-- | Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
reply_markup_message_id :: I53,
-- | A draft of a message in the chat; may be null
draft_message :: DraftMessage,
-- | Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if the message database is used
client_data :: T
}
deriving (Show, Eq, Generic)
data Chats
= -- | Represents a list of chats
Chats
{ -- | List of chat identifiers
chat_ids :: [I53]
}
deriving (Show, Eq, Generic)
data ChatNearby
= -- | Describes a chat located nearby
ChatNearby
{ -- | Chat identifier
chat_id :: I53,
-- | Distance to the chat location in meters
distance :: I32
}
deriving (Show, Eq, Generic)
data ChatsNearby
= -- | Represents a list of chats located nearby
ChatsNearby
{ -- | List of users nearby
users_nearby :: [ChatNearby],
-- | List of location-based supergroups nearby
supergroups_nearby :: [ChatNearby]
}
deriving (Show, Eq, Generic)
data ChatInviteLink
= -- | Contains a chat invite link
ChatInviteLink
{ -- | Chat invite link
invite_link :: T
}
deriving (Show, Eq, Generic)
data ChatInviteLinkInfo
= -- | Contains information about a chat invite link
ChatInviteLinkInfo
{ -- | Chat identifier of the invite link; 0 if the user is not a member of this chat
chat_id :: I53,
-- | Contains information about the type of the chat
type_ :: ChatType,
-- | Title of the chat
title :: T,
-- | Chat photo; may be null
photo :: ChatPhoto,
-- | Number of members in the chat
member_count :: I32,
-- | User identifiers of some chat members that may be known to the current user
member_user_ids :: [I32],
-- | True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup
is_public :: Bool
}
deriving (Show, Eq, Generic)
-- | Describes a type of public chats
data PublicChatType
= -- | The chat is public, because it has username
PublicChatTypeHasUsername
{
}
| -- | The chat is public, because it is a location-based supergroup
PublicChatTypeIsLocationBased
{
}
deriving (Show, Eq, Generic)
-- | Describes actions which should be possible to do through a chat action bar
data ChatActionBar
= -- | The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam
ChatActionBarReportSpam
{
}
| -- | The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation
ChatActionBarReportUnrelatedLocation
{
}
| -- | The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be added to the contact list using the method addContact, or the other user can be blocked using the method blockUser
ChatActionBarReportAddBlock
{
}
| -- | The chat is a private or secret chat and the other user can be added to the contact list using the method addContact
ChatActionBarAddContact
{
}
| -- | The chat is a private or secret chat with a mutual contact and the user's phone number can be shared with the other user using the method sharePhoneNumber
ChatActionBarSharePhoneNumber
{
}
deriving (Show, Eq, Generic)
-- | Describes a keyboard button type
data KeyboardButtonType
= -- | A simple button, with text that should be sent when the button is pressed
KeyboardButtonTypeText
{
}
| -- | A button that sends the user's phone number when pressed; available only in private chats
KeyboardButtonTypeRequestPhoneNumber
{
}
| -- | A button that sends the user's location when pressed; available only in private chats
KeyboardButtonTypeRequestLocation
{
}
| -- | A button that allows the user to create and send a poll when pressed; available only in private chats
KeyboardButtonTypeRequestPoll
{ -- | If true, only regular polls must be allowed to create
force_regular :: Bool,
-- | If true, only polls in quiz mode must be allowed to create
force_quiz :: Bool
}
deriving (Show, Eq, Generic)
data KeyboardButton
= -- | Represents a single button in a bot keyboard
KeyboardButton
{ -- | Text of the button
text :: T,
-- | Type of the button
type_ :: KeyboardButtonType
}
deriving (Show, Eq, Generic)
-- | Describes the type of an inline keyboard button
data InlineKeyboardButtonType
= -- | A button that opens a specified URL
InlineKeyboardButtonTypeUrl
{ -- | HTTP or tg:// URL to open
url :: T
}
| -- | A button that opens a specified URL and automatically logs in in current user if they allowed to do that
InlineKeyboardButtonTypeLoginUrl
{ -- | An HTTP URL to open
url :: T,
-- | Unique button identifier
id :: I32,
-- | If non-empty, new text of the button in forwarded messages
forward_text :: T
}
| -- | A button that sends a special callback query to a bot
InlineKeyboardButtonTypeCallback
{ -- | Data to be sent to the bot via a callback query
data_ :: ByteString64
}
| -- | A button with a game that sends a special callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame
InlineKeyboardButtonTypeCallbackGame
{
}
| -- | A button that forces an inline query to the bot to be inserted in the input field
InlineKeyboardButtonTypeSwitchInline
{ -- | Inline query to be sent to the bot
query :: T,
-- | True, if the inline query should be sent from the current chat
in_current_chat :: Bool
}
| -- | A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice
InlineKeyboardButtonTypeBuy
{
}
deriving (Show, Eq, Generic)
data InlineKeyboardButton
= -- | Represents a single button in an inline keyboard
InlineKeyboardButton
{ -- | Text of the button
text :: T,
-- | Type of the button
type_ :: InlineKeyboardButtonType
}
deriving (Show, Eq, Generic)
-- | Contains a description of a custom keyboard and actions that can be done with it to quickly reply to bots
data ReplyMarkup
= -- | Instructs clients to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, UpdateChatReplyMarkup with message_id == 0 will be sent
ReplyMarkupRemoveKeyboard
{ -- | True, if the keyboard is removed only for the mentioned users or the target user of a reply
is_personal :: Bool
}
| -- | Instructs clients to force a reply to this message
ReplyMarkupForceReply
{ -- | True, if a forced reply must automatically be shown to the current user. For outgoing messages, specify true to show the forced reply only for the mentioned users and for the target user of a reply
is_personal :: Bool
}
| -- | Contains a custom keyboard layout to quickly reply to bots
ReplyMarkupShowKeyboard
{ -- | A list of rows of bot keyboard buttons
rows_2 :: [[KeyboardButton]],
-- | True, if the client needs to resize the keyboard vertically
resize_keyboard :: Bool,
-- | True, if the client needs to hide the keyboard after use
one_time :: Bool,
-- | True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply
is_personal :: Bool
}
| -- | Contains an inline keyboard layout
ReplyMarkupInlineKeyboard
{ -- | A list of rows of inline keyboard buttons
rows :: [[InlineKeyboardButton]]
}
deriving (Show, Eq, Generic)
-- | Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl
data LoginUrlInfo
= -- | An HTTP url needs to be open
LoginUrlInfoOpen
{ -- | The URL to open
url :: T,
-- | True, if there is no need to show an ordinary open URL confirm
skip_confirm :: Bool
}
| -- | An authorization confirmation dialog needs to be shown to the user
LoginUrlInfoRequestConfirmation
{ -- | An HTTP URL to be opened
url :: T,
-- | A domain of the URL
domain :: T,
-- | User identifier of a bot linked with the website
bot_user_id :: I32,
-- | True, if the user needs to be requested to give the permission to the bot to send them messages
request_write_access :: Bool
}
deriving (Show, Eq, Generic)
-- | Describes a text object inside an instant-view web page
data RichText
= -- | A plain text
RichTextPlain
{ -- | Text
text_2 :: T
}
| -- | A bold rich text
RichTextBold
{ -- | Text
text :: RichText
}
| -- | An italicized rich text
RichTextItalic
{ -- | Text
text :: RichText
}
| -- | An underlined rich text
RichTextUnderline
{ -- | Text
text :: RichText
}
| -- | A strikethrough rich text
RichTextStrikethrough
{ -- | Text
text :: RichText
}
| -- | A fixed-width rich text
RichTextFixed
{ -- | Text
text :: RichText
}
| -- | A rich text URL link
RichTextUrl
{ -- | Text
text :: RichText,
-- | URL
url :: T,
-- | True, if the URL has cached instant view server-side
is_cached :: Bool
}
| -- | A rich text email link
RichTextEmailAddress
{ -- | Text
text :: RichText,
-- | Email address
email_address :: T
}
| -- | A subscript rich text
RichTextSubscript
{ -- | Text
text :: RichText
}
| -- | A superscript rich text
RichTextSuperscript
{ -- | Text
text :: RichText
}
| -- | A marked rich text
RichTextMarked
{ -- | Text
text :: RichText
}
| -- | A rich text phone number
RichTextPhoneNumber
{ -- | Text
text :: RichText,
-- | Phone number
phone_number :: T
}
| -- | A small image inside the text
RichTextIcon
{ -- | The image represented as a document. The image can be in GIF, JPEG or PNG format
document :: Document,
-- | Width of a bounding box in which the image should be shown; 0 if unknown
width :: I32,
-- | Height of a bounding box in which the image should be shown; 0 if unknown
height :: I32
}
| -- | A rich text reference of a text on the same web page
RichTextReference
{ -- | The text
text :: RichText,
-- | The text to show on click
reference_text :: RichText,
-- | An HTTP URL, opening the reference
url :: T
}
| -- | An anchor
RichTextAnchor
{ -- | Anchor name
name :: T
}
| -- | A link to an anchor on the same web page
RichTextAnchorLink
{ -- | The link text
text :: RichText,
-- | The anchor name. If the name is empty, the link should bring back to top
name :: T,
-- | An HTTP URL, opening the anchor
url :: T
}
| -- | A concatenation of rich texts
RichTexts
{ -- | Texts
texts :: [RichText]
}
deriving (Show, Eq, Generic)
data PageBlockCaption
= -- | Contains a caption of an instant view web page block, consisting of a text and a trailing credit
PageBlockCaption
{ -- | Content of the caption
text :: RichText,
-- | Block credit (like HTML tag <cite>)
credit :: RichText
}
deriving (Show, Eq, Generic)
data PageBlockListItem
= -- | Describes an item of a list page block
PageBlockListItem
{ -- | Item label
label :: T,
-- | Item blocks
page_blocks :: [PageBlock]
}
deriving (Show, Eq, Generic)
-- | Describes a horizontal alignment of a table cell content
data PageBlockHorizontalAlignment
= -- | The content should be left-aligned
PageBlockHorizontalAlignmentLeft
{
}
| -- | The content should be center-aligned
PageBlockHorizontalAlignmentCenter
{
}
| -- | The content should be right-aligned
PageBlockHorizontalAlignmentRight
{
}
deriving (Show, Eq, Generic)
-- | Describes a Vertical alignment of a table cell content
data PageBlockVerticalAlignment
= -- | The content should be top-aligned
PageBlockVerticalAlignmentTop
{
}
| -- | The content should be middle-aligned
PageBlockVerticalAlignmentMiddle
{
}
| -- | The content should be bottom-aligned
PageBlockVerticalAlignmentBottom
{
}
deriving (Show, Eq, Generic)
data PageBlockTableCell
= -- | Represents a cell of a table
PageBlockTableCell
{ -- | Cell text; may be null. If the text is null, then the cell should be invisible
text :: RichText,
-- | True, if it is a header cell
is_header :: Bool,
-- | The number of columns the cell should span
colspan :: I32,
-- | The number of rows the cell should span
rowspan :: I32,
-- | Horizontal cell content alignment
align :: PageBlockHorizontalAlignment,
-- | Vertical cell content alignment
valign :: PageBlockVerticalAlignment
}
deriving (Show, Eq, Generic)
data PageBlockRelatedArticle
= -- | Contains information about a related article
PageBlockRelatedArticle
{ -- | Related article URL
url :: T,
-- | Article title; may be empty
title :: T,
-- | Contains information about a related article
description :: T,
-- | Article photo; may be null
photo :: Photo,
-- | Article author; may be empty
author :: T,
-- | Point in time (Unix timestamp) when the article was published; 0 if unknown
publish_date :: I32
}
deriving (Show, Eq, Generic)
-- | Describes a block of an instant view web page
data PageBlock
= -- | The title of a page
PageBlockTitle
{ -- | Title
title_2 :: RichText
}
| -- | The subtitle of a page
PageBlockSubtitle
{ -- | Subtitle
subtitle :: RichText
}
| -- | The author and publishing date of a page
PageBlockAuthorDate
{ -- | Author
author_2 :: RichText,
-- | Point in time (Unix timestamp) when the article was published; 0 if unknown
publish_date :: I32
}
| -- | A header
PageBlockHeader
{ -- | Header
header :: RichText
}
| -- | A subheader
PageBlockSubheader
{ -- | Subheader
subheader :: RichText
}
| -- | A kicker
PageBlockKicker
{ -- | Kicker
kicker :: RichText
}
| -- | A text paragraph
PageBlockParagraph
{ -- | Paragraph text
text :: RichText
}
| -- | A preformatted text paragraph
PageBlockPreformatted
{ -- | Paragraph text
text :: RichText,
-- | Programming language for which the text should be formatted
language :: T
}
| -- | The footer of a page
PageBlockFooter
{ -- | Footer
footer :: RichText
}
| -- | An empty block separating a page
PageBlockDivider
{
}
| -- | An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor
PageBlockAnchor
{ -- | Name of the anchor
name :: T
}
| -- | A list of data blocks
PageBlockList
{ -- | The items of the list
items :: [PageBlockListItem]
}
| -- | A block quote
PageBlockBlockQuote
{ -- | Quote text
text :: RichText,
-- | Quote credit
credit :: RichText
}
| -- | A pull quote
PageBlockPullQuote
{ -- | Quote text
text :: RichText,
-- | Quote credit
credit :: RichText
}
| -- | An animation
PageBlockAnimation
{ -- | Animation file; may be null
animation :: Animation,
-- | Animation caption
caption :: PageBlockCaption,
-- | True, if the animation should be played automatically
need_autoplay :: Bool
}
| -- | An audio file
PageBlockAudio
{ -- | Audio file; may be null
audio :: Audio,
-- | Audio file caption
caption :: PageBlockCaption
}
| -- | A photo
PageBlockPhoto
{ -- | Photo file; may be null
photo_2 :: Photo,
-- | Photo caption
caption :: PageBlockCaption,
-- | URL that needs to be opened when the photo is clicked
url :: T
}
| -- | A video
PageBlockVideo
{ -- | Video file; may be null
video :: Video,
-- | Video caption
caption :: PageBlockCaption,
-- | True, if the video should be played automatically
need_autoplay :: Bool,
-- | True, if the video should be looped
is_looped :: Bool
}
| -- | A voice note
PageBlockVoiceNote
{ -- | Voice note; may be null
voice_note :: VoiceNote,
-- | Voice note caption
caption :: PageBlockCaption
}
| -- | A page cover
PageBlockCover
{ -- | Cover
cover :: PageBlock
}
| -- | An embedded web page
PageBlockEmbedded
{ -- | Web page URL, if available
url :: T,
-- | HTML-markup of the embedded page
html :: T,
-- | Poster photo, if available; may be null
poster_photo :: Photo,
-- | Block width; 0 if unknown
width :: I32,
-- | Block height; 0 if unknown
height :: I32,
-- | Block caption
caption :: PageBlockCaption,
-- | True, if the block should be full width
is_full_width :: Bool,
-- | True, if scrolling should be allowed
allow_scrolling :: Bool
}
| -- | An embedded post
PageBlockEmbeddedPost
{ -- | Web page URL
url :: T,
-- | Post author
author :: T,
-- | Post author photo; may be null
author_photo :: Photo,
-- | Point in time (Unix timestamp) when the post was created; 0 if unknown
date :: I32,
-- | Post content
page_blocks :: [PageBlock],
-- | Post caption
caption :: PageBlockCaption
}
| -- | A collage
PageBlockCollage
{ -- | Collage item contents
page_blocks :: [PageBlock],
-- | Block caption
caption :: PageBlockCaption
}
| -- | A slideshow
PageBlockSlideshow
{ -- | Slideshow item contents
page_blocks :: [PageBlock],
-- | Block caption
caption :: PageBlockCaption
}
| -- | A link to a chat
PageBlockChatLink
{ -- | Chat title
title :: T,
-- | Chat photo; may be null
photo :: ChatPhoto,
-- | Chat username, by which all other information about the chat should be resolved
username :: T
}
| -- | A table
PageBlockTable
{ -- | Table caption
caption_2 :: RichText,
-- | Table cells
cells :: [[PageBlockTableCell]],
-- | True, if the table is bordered
is_bordered :: Bool,
-- | True, if the table is striped
is_striped :: Bool
}
| -- | A collapsible block
PageBlockDetails
{ -- | Always visible heading for the block
header :: RichText,
-- | Block contents
page_blocks :: [PageBlock],
-- | True, if the block is open by default
is_open :: Bool
}
| -- | Related articles
PageBlockRelatedArticles
{ -- | Block header
header :: RichText,
-- | List of related articles
articles :: [PageBlockRelatedArticle]
}
| -- | A map
PageBlockMap
{ -- | Location of the map center
location :: Location,
-- | Map zoom level
zoom :: I32,
-- | Map width
width :: I32,
-- | Map height
height :: I32,
-- | Block caption
caption :: PageBlockCaption
}
deriving (Show, Eq, Generic)
data WebPageInstantView
= -- | Describes an instant view page for a web page
WebPageInstantView
{ -- | Content of the web page
page_blocks :: [PageBlock],
-- | Number of the instant view views; 0 if unknown
view_count :: I32,
-- | Version of the instant view, currently can be 1 or 2
version :: I32,
-- | True, if the instant view must be shown from right to left
is_rtl :: Bool,
-- | True, if the instant view contains the full page. A network request might be needed to get the full web page instant view
is_full :: Bool
}
deriving (Show, Eq, Generic)
data WebPage
= -- | Describes a web page preview
WebPage
{ -- | Original URL of the link
url :: T,
-- | URL to display
display_url :: T,
-- | Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else
type_ :: T,
-- | Short name of the site (e.g., Google Docs, App Store)
site_name :: T,
-- | Title of the content
title :: T,
-- | Describes a web page preview
description :: FormattedText,
-- | Image representing the content; may be null
photo :: Photo,
-- | URL to show in the embedded preview
embed_url :: T,
-- | MIME type of the embedded preview, (e.g., text/html or video/mp4)
embed_type :: T,
-- | Width of the embedded preview
embed_width :: I32,
-- | Height of the embedded preview
embed_height :: I32,
-- | Duration of the content, in seconds
duration :: I32,
-- | Author of the content
author :: T,
-- | Preview of the content as an animation, if available; may be null
animation :: Animation,
-- | Preview of the content as an audio file, if available; may be null
audio :: Audio,
-- | Preview of the content as a document, if available (currently only available for small PDF files and ZIP archives); may be null
document :: Document,
-- | Preview of the content as a sticker for small WEBP files, if available; may be null
sticker :: Sticker,
-- | Preview of the content as a video, if available; may be null
video :: Video,
-- | Preview of the content as a video note, if available; may be null
video_note :: VideoNote,
-- | Preview of the content as a voice note, if available; may be null
voice_note :: VoiceNote,
-- | Version of instant view, available for the web page (currently can be 1 or 2), 0 if none
instant_view_version :: I32
}
deriving (Show, Eq, Generic)
data BankCardActionOpenUrl
= -- | Describes an action associated with a bank card number
BankCardActionOpenUrl
{ -- | Action text
text :: T,
-- | The URL to be opened
url :: T
}
deriving (Show, Eq, Generic)
data BankCardInfo
= -- | Information about a bank card
BankCardInfo
{ -- | Title of the bank card description
title :: T,
-- | Actions that can be done with the bank card number
actions :: [BankCardActionOpenUrl]
}
deriving (Show, Eq, Generic)
data Address
= -- | Describes an address
Address
{ -- | A two-letter ISO 3166-1 alpha-2 country code
country_code :: T,
-- | State, if applicable
state :: T,
-- | City
city :: T,
-- | First line of the address
street_line1 :: T,
-- | Second line of the address
street_line2 :: T,
-- | Address postal code
postal_code :: T
}
deriving (Show, Eq, Generic)
data LabeledPricePart
= -- | Portion of the price of a product (e.g., "delivery cost", "tax amount")
LabeledPricePart
{ -- | Label for this portion of the product price
label :: T,
-- | Currency amount in minimal quantity of the currency
amount :: I53
}
deriving (Show, Eq, Generic)
data Invoice
= -- | Product invoice
Invoice
{ -- | ISO 4217 currency code
currency :: T,
-- | A list of objects used to calculate the total price of the product
price_parts :: [LabeledPricePart],
-- | True, if the payment is a test payment
is_test :: Bool,
-- | True, if the user's name is needed for payment
need_name :: Bool,
-- | True, if the user's phone number is needed for payment
need_phone_number :: Bool,
-- | True, if the user's email address is needed for payment
need_email_address :: Bool,
-- | True, if the user's shipping address is needed for payment
need_shipping_address :: Bool,
-- | True, if the user's phone number will be sent to the provider
send_phone_number_to_provider :: Bool,
-- | True, if the user's email address will be sent to the provider
send_email_address_to_provider :: Bool,
-- | True, if the total price depends on the shipping method
is_flexible :: Bool
}
deriving (Show, Eq, Generic)
data OrderInfo
= -- | Order information
OrderInfo
{ -- | Name of the user
name :: T,
-- | Phone number of the user
phone_number :: T,
-- | Email address of the user
email_address :: T,
-- | Shipping address for this order; may be null
shipping_address :: Address
}
deriving (Show, Eq, Generic)
data ShippingOption
= -- | One shipping option
ShippingOption
{ -- | Shipping option identifier
id :: T,
-- | Option title
title :: T,
-- | A list of objects used to calculate the total shipping costs
price_parts :: [LabeledPricePart]
}
deriving (Show, Eq, Generic)
data SavedCredentials
= -- | Contains information about saved card credentials
SavedCredentials
{ -- | Unique identifier of the saved credentials
id :: T,
-- | Title of the saved credentials
title :: T
}
deriving (Show, Eq, Generic)
-- | Contains information about the payment method chosen by the user
data InputCredentials
= -- | Applies if a user chooses some previously saved payment credentials. To use their previously saved credentials, the user must have a valid temporary password
InputCredentialsSaved
{ -- | Identifier of the saved credentials
saved_credentials_id :: T
}
| -- | Applies if a user enters new credentials on a payment provider website
InputCredentialsNew
{ -- | Contains JSON-encoded data with a credential identifier from the payment provider
data_ :: T,
-- | True, if the credential identifier can be saved on the server side
allow_save :: Bool
}
| -- | Applies if a user enters new credentials using Android Pay
InputCredentialsAndroidPay
{ -- | JSON-encoded data with the credential identifier
data_ :: T
}
| -- | Applies if a user enters new credentials using Apple Pay
InputCredentialsApplePay
{ -- | JSON-encoded data with the credential identifier
data_ :: T
}
deriving (Show, Eq, Generic)
data PaymentsProviderStripe
= -- | Stripe payment provider
PaymentsProviderStripe
{ -- | Stripe API publishable key
publishable_key :: T,
-- | True, if the user country must be provided
need_country :: Bool,
-- | True, if the user ZIP/postal code must be provided
need_postal_code :: Bool,
-- | True, if the cardholder name must be provided
need_cardholder_name :: Bool
}
deriving (Show, Eq, Generic)
data PaymentForm
= -- | Contains information about an invoice payment form
PaymentForm
{ -- | Full information of the invoice
invoice :: Invoice,
-- | Payment form URL
url :: T,
-- | Contains information about the payment provider, if available, to support it natively without the need for opening the URL; may be null
payments_provider :: PaymentsProviderStripe,
-- | Saved server-side order information; may be null
saved_order_info :: OrderInfo,
-- | Contains information about saved card credentials; may be null
saved_credentials :: SavedCredentials,
-- | True, if the user can choose to save credentials
can_save_credentials :: Bool,
-- | True, if the user will be able to save credentials protected by a password they set up
need_password :: Bool
}
deriving (Show, Eq, Generic)
data ValidatedOrderInfo
= -- | Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options
ValidatedOrderInfo
{ -- | Temporary identifier of the order information
order_info_id :: T,
-- | Available shipping options
shipping_options :: [ShippingOption]
}
deriving (Show, Eq, Generic)
data PaymentResult
= -- | Contains the result of a payment request
PaymentResult
{ -- | True, if the payment request was successful; otherwise the verification_url will be not empty
success :: Bool,
-- | URL for additional payment credentials verification
verification_url :: T
}
deriving (Show, Eq, Generic)
data PaymentReceipt
= -- | Contains information about a successful payment
PaymentReceipt
{ -- | Point in time (Unix timestamp) when the payment was made
date :: I32,
-- | User identifier of the payment provider bot
payments_provider_user_id :: I32,
-- | Contains information about the invoice
invoice :: Invoice,
-- | Contains order information; may be null
order_info :: OrderInfo,
-- | Chosen shipping option; may be null
shipping_option :: ShippingOption,
-- | Title of the saved credentials
credentials_title :: T
}
deriving (Show, Eq, Generic)
data DatedFile
= -- | File with the date it was uploaded
DatedFile
{ -- | The file
file :: File,
-- | Point in time (Unix timestamp) when the file was uploaded
date :: I32
}
deriving (Show, Eq, Generic)
-- | Contains the type of a Telegram Passport element
data PassportElementType
= -- | A Telegram Passport element containing the user's personal details
PassportElementTypePersonalDetails
{
}
| -- | A Telegram Passport element containing the user's passport
PassportElementTypePassport
{
}
| -- | A Telegram Passport element containing the user's driver license
PassportElementTypeDriverLicense
{
}
| -- | A Telegram Passport element containing the user's identity card
PassportElementTypeIdentityCard
{
}
| -- | A Telegram Passport element containing the user's internal passport
PassportElementTypeInternalPassport
{
}
| -- | A Telegram Passport element containing the user's address
PassportElementTypeAddress
{
}
| -- | A Telegram Passport element containing the user's utility bill
PassportElementTypeUtilityBill
{
}
| -- | A Telegram Passport element containing the user's bank statement
PassportElementTypeBankStatement
{
}
| -- | A Telegram Passport element containing the user's rental agreement
PassportElementTypeRentalAgreement
{
}
| -- | A Telegram Passport element containing the registration page of the user's passport
PassportElementTypePassportRegistration
{
}
| -- | A Telegram Passport element containing the user's temporary registration
PassportElementTypeTemporaryRegistration
{
}
| -- | A Telegram Passport element containing the user's phone number
PassportElementTypePhoneNumber
{
}
| -- | A Telegram Passport element containing the user's email address
PassportElementTypeEmailAddress
{
}
deriving (Show, Eq, Generic)
data Date
= -- | Represents a date according to the Gregorian calendar
Date
{ -- | Day of the month, 1-31
day :: I32,
-- | Month, 1-12
month :: I32,
-- | Year, 1-9999
year :: I32
}
deriving (Show, Eq, Generic)
data PersonalDetails
= -- | Contains the user's personal details
PersonalDetails
{ -- | First name of the user written in English; 1-255 characters
first_name :: T,
-- | Middle name of the user written in English; 0-255 characters
middle_name :: T,
-- | Last name of the user written in English; 1-255 characters
last_name :: T,
-- | Native first name of the user; 1-255 characters
native_first_name :: T,
-- | Native middle name of the user; 0-255 characters
native_middle_name :: T,
-- | Native last name of the user; 1-255 characters
native_last_name :: T,
-- | Birthdate of the user
birthdate :: Date,
-- | Gender of the user, "male" or "female"
gender :: T,
-- | A two-letter ISO 3166-1 alpha-2 country code of the user's country
country_code :: T,
-- | A two-letter ISO 3166-1 alpha-2 country code of the user's residence country
residence_country_code :: T
}
deriving (Show, Eq, Generic)
data IdentityDocument
= -- | An identity document
IdentityDocument
{ -- | Document number; 1-24 characters
number :: T,
-- | Document expiry date; may be null
expiry_date :: Date,
-- | Front side of the document
front_side :: DatedFile,
-- | Reverse side of the document; only for driver license and identity card
reverse_side :: DatedFile,
-- | Selfie with the document; may be null
selfie :: DatedFile,
-- | List of files containing a certified English translation of the document
translation :: [DatedFile]
}
deriving (Show, Eq, Generic)
data InputIdentityDocument
= -- | An identity document to be saved to Telegram Passport
InputIdentityDocument
{ -- | Document number; 1-24 characters
number :: T,
-- | Document expiry date, if available
expiry_date :: Date,
-- | Front side of the document
front_side :: InputFile,
-- | Reverse side of the document; only for driver license and identity card
reverse_side :: InputFile,
-- | Selfie with the document, if available
selfie :: InputFile,
-- | List of files containing a certified English translation of the document
translation :: [InputFile]
}
deriving (Show, Eq, Generic)
data PersonalDocument
= -- | A personal document, containing some information about a user
PersonalDocument
{ -- | List of files containing the pages of the document
files :: [DatedFile],
-- | List of files containing a certified English translation of the document
translation :: [DatedFile]
}
deriving (Show, Eq, Generic)
data InputPersonalDocument
= -- | A personal document to be saved to Telegram Passport
InputPersonalDocument
{ -- | List of files containing the pages of the document
files :: [InputFile],
-- | List of files containing a certified English translation of the document
translation :: [InputFile]
}
deriving (Show, Eq, Generic)
-- | Contains information about a Telegram Passport element
data PassportElement
= -- | A Telegram Passport element containing the user's personal details
PassportElementPersonalDetails
{ -- | Personal details of the user
personal_details :: PersonalDetails
}
| -- | A Telegram Passport element containing the user's passport
PassportElementPassport
{ -- | Passport
passport :: IdentityDocument
}
| -- | A Telegram Passport element containing the user's driver license
PassportElementDriverLicense
{ -- | Driver license
driver_license :: IdentityDocument
}
| -- | A Telegram Passport element containing the user's identity card
PassportElementIdentityCard
{ -- | Identity card
identity_card :: IdentityDocument
}
| -- | A Telegram Passport element containing the user's internal passport
PassportElementInternalPassport
{ -- | Internal passport
internal_passport :: IdentityDocument
}
| -- | A Telegram Passport element containing the user's address
PassportElementAddress
{ -- | Address
address :: Address
}
| -- | A Telegram Passport element containing the user's utility bill
PassportElementUtilityBill
{ -- | Utility bill
utility_bill :: PersonalDocument
}
| -- | A Telegram Passport element containing the user's bank statement
PassportElementBankStatement
{ -- | Bank statement
bank_statement :: PersonalDocument
}
| -- | A Telegram Passport element containing the user's rental agreement
PassportElementRentalAgreement
{ -- | Rental agreement
rental_agreement :: PersonalDocument
}
| -- | A Telegram Passport element containing the user's passport registration pages
PassportElementPassportRegistration
{ -- | Passport registration pages
passport_registration :: PersonalDocument
}
| -- | A Telegram Passport element containing the user's temporary registration
PassportElementTemporaryRegistration
{ -- | Temporary registration
temporary_registration :: PersonalDocument
}
| -- | A Telegram Passport element containing the user's phone number
PassportElementPhoneNumber
{ -- | Phone number
phone_number :: T
}
| -- | A Telegram Passport element containing the user's email address
PassportElementEmailAddress
{ -- | Email address
email_address :: T
}
deriving (Show, Eq, Generic)
-- | Contains information about a Telegram Passport element to be saved
data InputPassportElement
= -- | A Telegram Passport element to be saved containing the user's personal details
InputPassportElementPersonalDetails
{ -- | Personal details of the user
personal_details :: PersonalDetails
}
| -- | A Telegram Passport element to be saved containing the user's passport
InputPassportElementPassport
{ -- | The passport to be saved
passport :: InputIdentityDocument
}
| -- | A Telegram Passport element to be saved containing the user's driver license
InputPassportElementDriverLicense
{ -- | The driver license to be saved
driver_license :: InputIdentityDocument
}
| -- | A Telegram Passport element to be saved containing the user's identity card
InputPassportElementIdentityCard
{ -- | The identity card to be saved
identity_card :: InputIdentityDocument
}
| -- | A Telegram Passport element to be saved containing the user's internal passport
InputPassportElementInternalPassport
{ -- | The internal passport to be saved
internal_passport :: InputIdentityDocument
}
| -- | A Telegram Passport element to be saved containing the user's address
InputPassportElementAddress
{ -- | The address to be saved
address :: Address
}
| -- | A Telegram Passport element to be saved containing the user's utility bill
InputPassportElementUtilityBill
{ -- | The utility bill to be saved
utility_bill :: InputPersonalDocument
}
| -- | A Telegram Passport element to be saved containing the user's bank statement
InputPassportElementBankStatement
{ -- | The bank statement to be saved
bank_statement :: InputPersonalDocument
}
| -- | A Telegram Passport element to be saved containing the user's rental agreement
InputPassportElementRentalAgreement
{ -- | The rental agreement to be saved
rental_agreement :: InputPersonalDocument
}
| -- | A Telegram Passport element to be saved containing the user's passport registration
InputPassportElementPassportRegistration
{ -- | The passport registration page to be saved
passport_registration :: InputPersonalDocument
}
| -- | A Telegram Passport element to be saved containing the user's temporary registration
InputPassportElementTemporaryRegistration
{ -- | The temporary registration document to be saved
temporary_registration :: InputPersonalDocument
}
| -- | A Telegram Passport element to be saved containing the user's phone number
InputPassportElementPhoneNumber
{ -- | The phone number to be saved
phone_number :: T
}
| -- | A Telegram Passport element to be saved containing the user's email address
InputPassportElementEmailAddress
{ -- | The email address to be saved
email_address :: T
}
deriving (Show, Eq, Generic)
data PassportElements
= -- | Contains information about saved Telegram Passport elements
PassportElements
{ -- | Telegram Passport elements
elements :: [PassportElement]
}
deriving (Show, Eq, Generic)
-- | Contains the description of an error in a Telegram Passport element
data PassportElementErrorSource
= -- | The element contains an error in an unspecified place. The error will be considered resolved when new data is added
PassportElementErrorSourceUnspecified
{
}
| -- | One of the data fields contains an error. The error will be considered resolved when the value of the field changes
PassportElementErrorSourceDataField
{ -- | Field name
field_name :: T
}
| -- | The front side of the document contains an error. The error will be considered resolved when the file with the front side changes
PassportElementErrorSourceFrontSide
{
}
| -- | The reverse side of the document contains an error. The error will be considered resolved when the file with the reverse side changes
PassportElementErrorSourceReverseSide
{
}
| -- | The selfie with the document contains an error. The error will be considered resolved when the file with the selfie changes
PassportElementErrorSourceSelfie
{
}
| -- | One of files with the translation of the document contains an error. The error will be considered resolved when the file changes
PassportElementErrorSourceTranslationFile
{ -- | Index of a file with the error
file_index :: I32
}
| -- | The translation of the document contains an error. The error will be considered resolved when the list of translation files changes
PassportElementErrorSourceTranslationFiles
{
}
| -- | The file contains an error. The error will be considered resolved when the file changes
PassportElementErrorSourceFile
{ -- | Index of a file with the error
file_index :: I32
}
| -- | The list of attached files contains an error. The error will be considered resolved when the list of files changes
PassportElementErrorSourceFiles
{
}
deriving (Show, Eq, Generic)
data PassportElementError
= -- | Contains the description of an error in a Telegram Passport element
PassportElementError
{ -- | Type of the Telegram Passport element which has the error
type_ :: PassportElementType,
-- | Error message
message :: T,
-- | Error source
source :: PassportElementErrorSource
}
deriving (Show, Eq, Generic)
data PassportSuitableElement
= -- | Contains information about a Telegram Passport element that was requested by a service
PassportSuitableElement
{ -- | Type of the element
type_ :: PassportElementType,
-- | True, if a selfie is required with the identity document
is_selfie_required :: Bool,
-- | True, if a certified English translation is required with the document
is_translation_required :: Bool,
-- | True, if personal details must include the user's name in the language of their country of residence
is_native_name_required :: Bool
}
deriving (Show, Eq, Generic)
data PassportRequiredElement
= -- | Contains a description of the required Telegram Passport element that was requested by a service
PassportRequiredElement
{ -- | List of Telegram Passport elements any of which is enough to provide
suitable_elements :: [PassportSuitableElement]
}
deriving (Show, Eq, Generic)
data PassportAuthorizationForm
= -- | Contains information about a Telegram Passport authorization form that was requested
PassportAuthorizationForm
{ -- | Unique identifier of the authorization form
id :: I32,
-- | Information about the Telegram Passport elements that need to be provided to complete the form
required_elements :: [PassportRequiredElement],
-- | URL for the privacy policy of the service; may be empty
privacy_policy_url :: T
}
deriving (Show, Eq, Generic)
data PassportElementsWithErrors
= -- | Contains information about a Telegram Passport elements and corresponding errors
PassportElementsWithErrors
{ -- | Telegram Passport elements
elements :: [PassportElement],
-- | Errors in the elements that are already available
errors :: [PassportElementError]
}
deriving (Show, Eq, Generic)
data EncryptedCredentials
= -- | Contains encrypted Telegram Passport data credentials
EncryptedCredentials
{ -- | The encrypted credentials
data_ :: ByteString64,
-- | The decrypted data hash
hash :: ByteString64,
-- | Secret for data decryption, encrypted with the service's public key
secret :: ByteString64
}
deriving (Show, Eq, Generic)
data EncryptedPassportElement
= -- | Contains information about an encrypted Telegram Passport element; for bots only
EncryptedPassportElement
{ -- | Type of Telegram Passport element
type_ :: PassportElementType,
-- | Encrypted JSON-encoded data about the user
data_ :: ByteString64,
-- | The front side of an identity document
front_side :: DatedFile,
-- | The reverse side of an identity document; may be null
reverse_side :: DatedFile,
-- | Selfie with the document; may be null
selfie :: DatedFile,
-- | List of files containing a certified English translation of the document
translation :: [DatedFile],
-- | List of attached files
files :: [DatedFile],
-- | Unencrypted data, phone number or email address
value :: T,
-- | Hash of the entire element
hash :: T
}
deriving (Show, Eq, Generic)
-- | Contains the description of an error in a Telegram Passport element; for bots only
data InputPassportElementErrorSource
= -- | The element contains an error in an unspecified place. The error will be considered resolved when new data is added
InputPassportElementErrorSourceUnspecified
{ -- | Current hash of the entire element
element_hash :: ByteString64
}
| -- | A data field contains an error. The error is considered resolved when the field's value changes
InputPassportElementErrorSourceDataField
{ -- | Field name
field_name :: T,
-- | Current data hash
data_hash :: ByteString64
}
| -- | The front side of the document contains an error. The error is considered resolved when the file with the front side of the document changes
InputPassportElementErrorSourceFrontSide
{ -- | Current hash of the file containing the front side
file_hash :: ByteString64
}
| -- | The reverse side of the document contains an error. The error is considered resolved when the file with the reverse side of the document changes
InputPassportElementErrorSourceReverseSide
{ -- | Current hash of the file containing the reverse side
file_hash :: ByteString64
}
| -- | The selfie contains an error. The error is considered resolved when the file with the selfie changes
InputPassportElementErrorSourceSelfie
{ -- | Current hash of the file containing the selfie
file_hash :: ByteString64
}
| -- | One of the files containing the translation of the document contains an error. The error is considered resolved when the file with the translation changes
InputPassportElementErrorSourceTranslationFile
{ -- | Current hash of the file containing the translation
file_hash :: ByteString64
}
| -- | The translation of the document contains an error. The error is considered resolved when the list of files changes
InputPassportElementErrorSourceTranslationFiles
{ -- | Current hashes of all files with the translation
file_hashes :: [ByteString64]
}
| -- | The file contains an error. The error is considered resolved when the file changes
InputPassportElementErrorSourceFile
{ -- | Current hash of the file which has the error
file_hash :: ByteString64
}
| -- | The list of attached files contains an error. The error is considered resolved when the file list changes
InputPassportElementErrorSourceFiles
{ -- | Current hashes of all attached files
file_hashes :: [ByteString64]
}
deriving (Show, Eq, Generic)
data InputPassportElementError
= -- | Contains the description of an error in a Telegram Passport element; for bots only
InputPassportElementError
{ -- | Type of Telegram Passport element that has the error
type_ :: PassportElementType,
-- | Error message
message :: T,
-- | Error source
source :: InputPassportElementErrorSource
}
deriving (Show, Eq, Generic)
-- | Contains the content of a message
data MessageContent
= -- | A text message
MessageText
{ -- | Text of the message
text_2 :: FormattedText,
-- | A preview of the web page that's mentioned in the text; may be null
web_page :: WebPage
}
| -- | An animation message (GIF-style).
MessageAnimation
{ -- | The animation description
animation :: Animation,
-- | Animation caption
caption :: FormattedText,
-- | True, if the animation thumbnail must be blurred and the animation must be shown only while tapped
is_secret :: Bool
}
| -- | An audio message
MessageAudio
{ -- | The audio description
audio :: Audio,
-- | Audio caption
caption :: FormattedText
}
| -- | A document message (general file)
MessageDocument
{ -- | The document description
document :: Document,
-- | Document caption
caption :: FormattedText
}
| -- | A photo message
MessagePhoto
{ -- | The photo description
photo :: Photo,
-- | Photo caption
caption :: FormattedText,
-- | True, if the photo must be blurred and must be shown only while tapped
is_secret :: Bool
}
| -- | An expired photo message (self-destructed after TTL has elapsed)
MessageExpiredPhoto
{
}
| -- | A sticker message
MessageSticker
{ -- | The sticker description
sticker :: Sticker
}
| -- | A video message
MessageVideo
{ -- | The video description
video :: Video,
-- | Video caption
caption :: FormattedText,
-- | True, if the video thumbnail must be blurred and the video must be shown only while tapped
is_secret :: Bool
}
| -- | An expired video message (self-destructed after TTL has elapsed)
MessageExpiredVideo
{
}
| -- | A video note message
MessageVideoNote
{ -- | The video note description
video_note :: VideoNote,
-- | True, if at least one of the recipients has viewed the video note
is_viewed :: Bool,
-- | True, if the video note thumbnail must be blurred and the video note must be shown only while tapped
is_secret :: Bool
}
| -- | A voice note message
MessageVoiceNote
{ -- | The voice note description
voice_note :: VoiceNote,
-- | Voice note caption
caption :: FormattedText,
-- | True, if at least one of the recipients has listened to the voice note
is_listened :: Bool
}
| -- | A message with a location
MessageLocation
{ -- | The location description
location :: Location,
-- | Time relative to the message sent date until which the location can be updated, in seconds
live_period :: I32,
-- | Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes
expires_in :: I32
}
| -- | A message with information about a venue
MessageVenue
{ -- | The venue description
venue :: Venue
}
| -- | A message with a user contact
MessageContact
{ -- | The contact description
contact :: Contact
}
| -- | A dice message. The dice value is randomly generated by the server
MessageDice
{ -- | The animated sticker with the initial dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known
initial_state_sticker :: Sticker,
-- | The animated sticker with the final dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known
final_state_sticker :: Sticker,
-- | Emoji on which the dice throw animation is based
emoji :: T,
-- | The dice value. If the value is 0, the dice don't have final state yet
value :: I32,
-- | Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded
success_animation_frame_number :: I32
}
| -- | A message with a game
MessageGame
{ -- | The game description
game :: Game
}
| -- | A message with a poll
MessagePoll
{ -- | The poll description
poll :: Poll
}
| -- | A message with an invoice from a bot
MessageInvoice
{ -- | Product title
title :: T,
-- | A message with an invoice from a bot
description :: T,
-- | Product photo; may be null
photo :: Photo,
-- | Currency for the product price
currency :: T,
-- | Product total price in the minimal quantity of the currency
total_amount :: I53,
-- | Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter}
start_parameter :: T,
-- | True, if the invoice is a test invoice
is_test :: Bool,
-- | True, if the shipping address should be specified
need_shipping_address :: Bool,
-- | The identifier of the message with the receipt, after the product has been purchased
receipt_message_id :: I53
}
| -- | A message with information about an ended call
MessageCall
{ -- | Reason why the call was discarded
discard_reason :: CallDiscardReason,
-- | Call duration, in seconds
duration :: I32
}
| -- | A newly created basic group
MessageBasicGroupChatCreate
{ -- | Title of the basic group
title :: T,
-- | User identifiers of members in the basic group
member_user_ids :: [I32]
}
| -- | A newly created supergroup or channel
MessageSupergroupChatCreate
{ -- | Title of the supergroup or channel
title :: T
}
| -- | An updated chat title
MessageChatChangeTitle
{ -- | New chat title
title :: T
}
| -- | An updated chat photo
MessageChatChangePhoto
{ -- | New chat photo
photo :: Photo
}
| -- | A deleted chat photo
MessageChatDeletePhoto
{
}
| -- | New chat members were added
MessageChatAddMembers
{ -- | User identifiers of the new members
member_user_ids :: [I32]
}
| -- | A new member joined the chat by invite link
MessageChatJoinByLink
{
}
| -- | A chat member was deleted
MessageChatDeleteMember
{ -- | User identifier of the deleted chat member
user_id :: I32
}
| -- | A basic group was upgraded to a supergroup and was deactivated as the result
MessageChatUpgradeTo
{ -- | Identifier of the supergroup to which the basic group was upgraded
supergroup_id :: I32
}
| -- | A supergroup has been created from a basic group
MessageChatUpgradeFrom
{ -- | Title of the newly created supergroup
title :: T,
-- | The identifier of the original basic group
basic_group_id :: I32
}
| -- | A message has been pinned
MessagePinMessage
{ -- | Identifier of the pinned message, can be an identifier of a deleted message or 0
message_id :: I53
}
| -- | A screenshot of a message in the chat has been taken
MessageScreenshotTaken
{
}
| -- | The TTL (Time To Live) setting messages in a secret chat has been changed
MessageChatSetTtl
{ -- | New TTL
ttl :: I32
}
| -- | A non-standard action has happened in the chat
MessageCustomServiceAction
{ -- | Message text to be shown in the chat
text :: T
}
| -- | A new high score was achieved in a game
MessageGameScore
{ -- | Identifier of the message with the game, can be an identifier of a deleted message
game_message_id :: I53,
-- | Identifier of the game; may be different from the games presented in the message with the game
game_id :: I64,
-- | New score
score :: I32
}
| -- | A payment has been completed
MessagePaymentSuccessful
{ -- | Identifier of the message with the corresponding invoice; can be an identifier of a deleted message
invoice_message_id :: I53,
-- | Currency for the price of the product
currency :: T,
-- | Total price for the product, in the minimal quantity of the currency
total_amount :: I53
}
| -- | A payment has been completed; for bots only
MessagePaymentSuccessfulBot
{ -- | Identifier of the message with the corresponding invoice; can be an identifier of a deleted message
invoice_message_id :: I53,
-- | Currency for price of the product
currency :: T,
-- | Total price for the product, in the minimal quantity of the currency
total_amount :: I53,
-- | Invoice payload
invoice_payload :: ByteString64,
-- | Identifier of the shipping option chosen by the user; may be empty if not applicable
shipping_option_id :: T,
-- | Information about the order; may be null
order_info :: OrderInfo,
-- | Telegram payment identifier
telegram_payment_charge_id :: T,
-- | Provider payment identifier
provider_payment_charge_id :: T
}
| -- | A contact has registered with Telegram
MessageContactRegistered
{
}
| -- | The current user has connected a website by logging in using Telegram Login Widget on it
MessageWebsiteConnected
{ -- | Domain name of the connected website
domain_name :: T
}
| -- | Telegram Passport data has been sent
MessagePassportDataSent
{ -- | List of Telegram Passport element types sent
types :: [PassportElementType]
}
| -- | Telegram Passport data has been received; for bots only
MessagePassportDataReceived
{ -- | List of received Telegram Passport elements
elements :: [EncryptedPassportElement],
-- | Encrypted data credentials
credentials :: EncryptedCredentials
}
| -- | Message content that is not supported by the client
MessageUnsupported
{
}
deriving (Show, Eq, Generic)
-- | Represents a part of the text which must be formatted differently
data TextEntityType
= -- | A mention of a user by their username
TextEntityTypeMention
{
}
| -- | A hashtag text, beginning with "#"
TextEntityTypeHashtag
{
}
| -- | A cashtag text, beginning with "$" and consisting of capital english letters (i.e. "$USD")
TextEntityTypeCashtag
{
}
| -- | A bot command, beginning with "/". This shouldn't be highlighted if there are no bots in the chat
TextEntityTypeBotCommand
{
}
| -- | An HTTP URL
TextEntityTypeUrl
{
}
| -- | An email address
TextEntityTypeEmailAddress
{
}
| -- | A phone number
TextEntityTypePhoneNumber
{
}
| -- | A bank card number. The getBankCardInfo method can be used to get information about the bank card
TextEntityTypeBankCardNumber
{
}
| -- | A bold text
TextEntityTypeBold
{
}
| -- | An italic text
TextEntityTypeItalic
{
}
| -- | An underlined text
TextEntityTypeUnderline
{
}
| -- | A strikethrough text
TextEntityTypeStrikethrough
{
}
| -- | Text that must be formatted as if inside a code HTML tag
TextEntityTypeCode
{
}
| -- | Text that must be formatted as if inside a pre HTML tag
TextEntityTypePre
{
}
| -- | Text that must be formatted as if inside pre, and code HTML tags
TextEntityTypePreCode
{ -- | Programming language of the code; as defined by the sender
language :: T
}
| -- | A text description shown instead of a raw URL
TextEntityTypeTextUrl
{ -- | HTTP or tg:// URL to be opened when the link is clicked
url :: T
}
| -- | A text shows instead of a raw mention of the user (e.g., when the user has no username)
TextEntityTypeMentionName
{ -- | Identifier of the mentioned user
user_id :: I32
}
deriving (Show, Eq, Generic)
data InputThumbnail
= -- | A thumbnail to be sent along with a file; should be in JPEG or WEBP format for stickers, and less than 200 KB in size
InputThumbnail
{ -- | Thumbnail file to send. Sending thumbnails by file_id is currently not supported
thumbnail :: InputFile,
-- | Thumbnail width, usually shouldn't exceed 320. Use 0 if unknown
width :: I32,
-- | Thumbnail height, usually shouldn't exceed 320. Use 0 if unknown
height :: I32
}
deriving (Show, Eq, Generic)
-- | Contains information about the time when a scheduled message will be sent
data MessageSchedulingState
= -- | The message will be sent at the specified date
MessageSchedulingStateSendAtDate
{ -- | Date the message will be sent. The date must be within 367 days in the future
send_date :: I32
}
| -- | The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known
MessageSchedulingStateSendWhenOnline
{
}
deriving (Show, Eq, Generic)
data SendMessageOptions
= -- | Options to be used when a message is send
SendMessageOptions
{ -- | Pass true to disable notification for the message. Must be false if the message is sent to a secret chat
disable_notification :: Bool,
-- | Pass true if the message is sent from the background
from_background :: Bool,
-- | Message scheduling state. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled
scheduling_state :: MessageSchedulingState
}
deriving (Show, Eq, Generic)
-- | The content of a message to send
data InputMessageContent
= -- | A text message
InputMessageText
{ -- | Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually
text :: FormattedText,
-- | True, if rich web page previews for URLs in the message text should be disabled
disable_web_page_preview :: Bool,
-- | True, if a chat message draft should be deleted
clear_draft :: Bool
}
| -- | An animation message (GIF-style).
InputMessageAnimation
{ -- | Animation file to be sent
animation :: InputFile,
-- | Animation thumbnail, if available
thumbnail :: InputThumbnail,
-- | Duration of the animation, in seconds
duration :: I32,
-- | Width of the animation; may be replaced by the server
width :: I32,
-- | Height of the animation; may be replaced by the server
height :: I32,
-- | Animation caption; 0-GetOption("message_caption_length_max") characters
caption :: FormattedText
}
| -- | An audio message
InputMessageAudio
{ -- | Audio file to be sent
audio :: InputFile,
-- | Thumbnail of the cover for the album, if available
album_cover_thumbnail :: InputThumbnail,
-- | Duration of the audio, in seconds; may be replaced by the server
duration :: I32,
-- | Title of the audio; 0-64 characters; may be replaced by the server
title :: T,
-- | Performer of the audio; 0-64 characters, may be replaced by the server
performer :: T,
-- | Audio caption; 0-GetOption("message_caption_length_max") characters
caption :: FormattedText
}
| -- | A document message (general file)
InputMessageDocument
{ -- | Document to be sent
document :: InputFile,
-- | Document thumbnail, if available
thumbnail :: InputThumbnail,
-- | Document caption; 0-GetOption("message_caption_length_max") characters
caption :: FormattedText
}
| -- | A photo message
InputMessagePhoto
{ -- | Photo to send
photo :: InputFile,
-- | Photo thumbnail to be sent, this is sent to the other party in secret chats only
thumbnail :: InputThumbnail,
-- | File identifiers of the stickers added to the photo, if applicable
added_sticker_file_ids :: [I32],
-- | Photo width
width :: I32,
-- | Photo height
height :: I32,
-- | Photo caption; 0-GetOption("message_caption_length_max") characters
caption :: FormattedText,
-- | Photo TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats
ttl :: I32
}
| -- | A sticker message
InputMessageSticker
{ -- | Sticker to be sent
sticker :: InputFile,
-- | Sticker thumbnail, if available
thumbnail :: InputThumbnail,
-- | Sticker width
width :: I32,
-- | Sticker height
height :: I32
}
| -- | A video message
InputMessageVideo
{ -- | Video to be sent
video :: InputFile,
-- | Video thumbnail, if available
thumbnail :: InputThumbnail,
-- | File identifiers of the stickers added to the video, if applicable
added_sticker_file_ids :: [I32],
-- | Duration of the video, in seconds
duration :: I32,
-- | Video width
width :: I32,
-- | Video height
height :: I32,
-- | True, if the video should be tried to be streamed
supports_streaming :: Bool,
-- | Video caption; 0-GetOption("message_caption_length_max") characters
caption :: FormattedText,
-- | Video TTL (Time To Live), in seconds (0-60). A non-zero TTL can be specified only in private chats
ttl :: I32
}
| -- | A video note message
InputMessageVideoNote
{ -- | Video note to be sent
video_note :: InputFile,
-- | Video thumbnail, if available
thumbnail :: InputThumbnail,
-- | Duration of the video, in seconds
duration :: I32,
-- | Video width and height; must be positive and not greater than 640
length :: I32
}
| -- | A voice note message
InputMessageVoiceNote
{ -- | Voice note to be sent
voice_note :: InputFile,
-- | Duration of the voice note, in seconds
duration :: I32,
-- | Waveform representation of the voice note, in 5-bit format
waveform :: ByteString64,
-- | Voice note caption; 0-GetOption("message_caption_length_max") characters
caption :: FormattedText
}
| -- | A message with a location
InputMessageLocation
{ -- | Location to be sent
location :: Location,
-- | Period for which the location can be updated, in seconds; should be between 60 and 86400 for a live location and 0 otherwise
live_period :: I32
}
| -- | A message with information about a venue
InputMessageVenue
{ -- | Venue to send
venue :: Venue
}
| -- | A message containing a user contact
InputMessageContact
{ -- | Contact to send
contact :: Contact
}
| -- | A dice message
InputMessageDice
{ -- | Emoji on which the dice throw animation is based
emoji :: T,
-- | True, if a chat message draft should be deleted
clear_draft :: Bool
}
| -- | A message with a game; not supported for channels or secret chats
InputMessageGame
{ -- | User identifier of the bot that owns the game
bot_user_id :: I32,
-- | Short name of the game
game_short_name :: T
}
| -- | A message with an invoice; can be used only by bots and only in private chats
InputMessageInvoice
{ -- | Invoice
invoice :: Invoice,
-- | Product title; 1-32 characters
title :: T,
-- | A message with an invoice; can be used only by bots and only in private chats
description :: T,
-- | Product photo URL; optional
photo_url :: T,
-- | Product photo size
photo_size :: I32,
-- | Product photo width
photo_width :: I32,
-- | Product photo height
photo_height :: I32,
-- | The invoice payload
payload :: ByteString64,
-- | Payment provider token
provider_token :: T,
-- | JSON-encoded data about the invoice, which will be shared with the payment provider
provider_data :: T,
-- | Unique invoice bot start_parameter for the generation of this invoice
start_parameter :: T
}
| -- | A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot
InputMessagePoll
{ -- | Poll question, 1-255 characters
question :: T,
-- | List of poll answer options, 2-10 strings 1-100 characters each
options :: [T],
-- | True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels
is_anonymous :: Bool,
-- | Type of the poll
type_ :: PollType,
-- | Amount of time the poll will be active after creation, in seconds; for bots only
open_period :: I32,
-- | Point in time (Unix timestamp) when the poll will be automatically closed; for bots only
close_date :: I32,
-- | True, if the poll needs to be sent already closed; for bots only
is_closed :: Bool
}
| -- | A forwarded message
InputMessageForwarded
{ -- | Identifier for the chat this forwarded message came from
from_chat_id :: I53,
-- | Identifier of the message to forward
message_id :: I53,
-- | True, if a game message should be shared within a launched game; applies only to game messages
in_game_share :: Bool,
-- | True, if content of the message needs to be copied without a link to the original message. Always true if the message is forwarded to a secret chat
send_copy :: Bool,
-- | True, if media caption of the message copy needs to be removed. Ignored if send_copy is false
remove_caption :: Bool
}
deriving (Show, Eq, Generic)
-- | Represents a filter for message search results
data SearchMessagesFilter
= -- | Returns all found messages, no filter is applied
SearchMessagesFilterEmpty
{
}
| -- | Returns only animation messages
SearchMessagesFilterAnimation
{
}
| -- | Returns only audio messages
SearchMessagesFilterAudio
{
}
| -- | Returns only document messages
SearchMessagesFilterDocument
{
}
| -- | Returns only photo messages
SearchMessagesFilterPhoto
{
}
| -- | Returns only video messages
SearchMessagesFilterVideo
{
}
| -- | Returns only voice note messages
SearchMessagesFilterVoiceNote
{
}
| -- | Returns only photo and video messages
SearchMessagesFilterPhotoAndVideo
{
}
| -- | Returns only messages containing URLs
SearchMessagesFilterUrl
{
}
| -- | Returns only messages containing chat photos
SearchMessagesFilterChatPhoto
{
}
| -- | Returns only call messages
SearchMessagesFilterCall
{
}
| -- | Returns only incoming call messages with missed/declined discard reasons
SearchMessagesFilterMissedCall
{
}
| -- | Returns only video note messages
SearchMessagesFilterVideoNote
{
}
| -- | Returns only voice and video note messages
SearchMessagesFilterVoiceAndVideoNote
{
}
| -- | Returns only messages with mentions of the current user, or messages that are replies to their messages
SearchMessagesFilterMention
{
}
| -- | Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can't be additionally filtered by a query or by the sending user
SearchMessagesFilterUnreadMention
{
}
| -- | Returns only failed to send messages. This filter can be used only if the message database is used
SearchMessagesFilterFailedToSend
{
}
deriving (Show, Eq, Generic)
-- | Describes the different types of activity in a chat
data ChatAction
= -- | The user is typing a message
ChatActionTyping
{
}
| -- | The user is recording a video
ChatActionRecordingVideo
{
}
| -- | The user is uploading a video
ChatActionUploadingVideo
{ -- | Upload progress, as a percentage
progress :: I32
}
| -- | The user is recording a voice note
ChatActionRecordingVoiceNote
{
}
| -- | The user is uploading a voice note
ChatActionUploadingVoiceNote
{ -- | Upload progress, as a percentage
progress :: I32
}
| -- | The user is uploading a photo
ChatActionUploadingPhoto
{ -- | Upload progress, as a percentage
progress :: I32
}
| -- | The user is uploading a document
ChatActionUploadingDocument
{ -- | Upload progress, as a percentage
progress :: I32
}
| -- | The user is picking a location or venue to send
ChatActionChoosingLocation
{
}
| -- | The user is picking a contact to send
ChatActionChoosingContact
{
}
| -- | The user has started to play a game
ChatActionStartPlayingGame
{
}
| -- | The user is recording a video note
ChatActionRecordingVideoNote
{
}
| -- | The user is uploading a video note
ChatActionUploadingVideoNote
{ -- | Upload progress, as a percentage
progress :: I32
}
| -- | The user has cancelled the previous action
ChatActionCancel
{
}
deriving (Show, Eq, Generic)
-- | Describes the last time the user was online
data UserStatus
= -- | The user status was never changed
UserStatusEmpty
{
}
| -- | The user is online
UserStatusOnline
{ -- | Point in time (Unix timestamp) when the user's online status will expire
expires :: I32
}
| -- | The user is offline
UserStatusOffline
{ -- | Point in time (Unix timestamp) when the user was last online
was_online :: I32
}
| -- | The user was online recently
UserStatusRecently
{
}
| -- | The user is offline, but was online last week
UserStatusLastWeek
{
}
| -- | The user is offline, but was online last month
UserStatusLastMonth
{
}
deriving (Show, Eq, Generic)
data Stickers
= -- | Represents a list of stickers
Stickers
{ -- | List of stickers
stickers :: [Sticker]
}
deriving (Show, Eq, Generic)
data Emojis
= -- | Represents a list of emoji
Emojis
{ -- | List of emojis
emojis :: [T]
}
deriving (Show, Eq, Generic)
data StickerSet
= -- | Represents a sticker set
StickerSet
{ -- | Identifier of the sticker set
id :: I64,
-- | Title of the sticker set
title :: T,
-- | Name of the sticker set
name :: T,
-- | Sticker set thumbnail in WEBP format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed
thumbnail :: PhotoSize,
-- | True, if the sticker set has been installed by the current user
is_installed :: Bool,
-- | True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
is_archived :: Bool,
-- | True, if the sticker set is official
is_official :: Bool,
-- | True, is the stickers in the set are animated
is_animated :: Bool,
-- | True, if the stickers in the set are masks
is_masks :: Bool,
-- | True for already viewed trending sticker sets
is_viewed :: Bool,
-- | List of stickers in this set
stickers :: [Sticker],
-- | A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object
emojis :: [Emojis]
}
deriving (Show, Eq, Generic)
data StickerSetInfo
= -- | Represents short information about a sticker set
StickerSetInfo
{ -- | Identifier of the sticker set
id :: I64,
-- | Title of the sticker set
title :: T,
-- | Name of the sticker set
name :: T,
-- | Sticker set thumbnail in WEBP format with width and height 100; may be null
thumbnail :: PhotoSize,
-- | True, if the sticker set has been installed by current user
is_installed :: Bool,
-- | True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
is_archived :: Bool,
-- | True, if the sticker set is official
is_official :: Bool,
-- | True, is the stickers in the set are animated
is_animated :: Bool,
-- | True, if the stickers in the set are masks
is_masks :: Bool,
-- | True for already viewed trending sticker sets
is_viewed :: Bool,
-- | Total number of stickers in the set
size :: I32,
-- | Contains up to the first 5 stickers from the set, depending on the context. If the client needs more stickers the full set should be requested
covers :: [Sticker]
}
deriving (Show, Eq, Generic)
data StickerSets
= -- | Represents a list of sticker sets
StickerSets
{ -- | Approximate total number of sticker sets found
total_count :: I32,
-- | List of sticker sets
sets :: [StickerSetInfo]
}
deriving (Show, Eq, Generic)
-- | Describes the reason why a call was discarded
data CallDiscardReason
= -- | The call wasn't discarded, or the reason is unknown
CallDiscardReasonEmpty
{
}
| -- | The call was ended before the conversation started. It was cancelled by the caller or missed by the other party
CallDiscardReasonMissed
{
}
| -- | The call was ended before the conversation started. It was declined by the other party
CallDiscardReasonDeclined
{
}
| -- | The call was ended during the conversation because the users were disconnected
CallDiscardReasonDisconnected
{
}
| -- | The call was ended because one of the parties hung up
CallDiscardReasonHungUp
{
}
deriving (Show, Eq, Generic)
data CallProtocol
= -- | Specifies the supported call protocols
CallProtocol
{ -- | True, if UDP peer-to-peer connections are supported
udp_p2p :: Bool,
-- | True, if connection through UDP reflectors is supported
udp_reflector :: Bool,
-- | The minimum supported API layer; use 65
min_layer :: I32,
-- | The maximum supported API layer; use 65
max_layer :: I32,
-- | List of supported libtgvoip versions
library_versions :: [T]
}
deriving (Show, Eq, Generic)
data CallConnection
= -- | Describes the address of UDP reflectors
CallConnection
{ -- | Reflector identifier
id :: I64,
-- | IPv4 reflector address
ip :: T,
-- | IPv6 reflector address
ipv6 :: T,
-- | Reflector port number
port :: I32,
-- | Connection peer tag
peer_tag :: ByteString64
}
deriving (Show, Eq, Generic)
data CallId
= -- | Contains the call identifier
CallId
{ -- | Call identifier
id :: I32
}
deriving (Show, Eq, Generic)
-- | Describes the current call state
data CallState
= -- | The call is pending, waiting to be accepted by a user
CallStatePending
{ -- | True, if the call has already been created by the server
is_created :: Bool,
-- | True, if the call has already been received by the other party
is_received :: Bool
}
| -- | The call has been answered and encryption keys are being exchanged
CallStateExchangingKeys
{
}
| -- | The call is ready to use
CallStateReady
{ -- | Call protocols supported by the peer
protocol :: CallProtocol,
-- | Available UDP reflectors
connections :: [CallConnection],
-- | A JSON-encoded call config
config :: T,
-- | Call encryption key
encryption_key :: ByteString64,
-- | Encryption key emojis fingerprint
emojis :: [T],
-- | True, if peer-to-peer connection is allowed by users privacy settings
allow_p2p :: Bool
}
| -- | The call is hanging up after discardCall has been called
CallStateHangingUp
{
}
| -- | The call has ended successfully
CallStateDiscarded
{ -- | The reason, why the call has ended
reason :: CallDiscardReason,
-- | True, if the call rating should be sent to the server
need_rating :: Bool,
-- | True, if the call debug information should be sent to the server
need_debug_information :: Bool
}
| -- | The call has ended with an error
CallStateError
{ -- | Error. An error with the code 4005000 will be returned if an outgoing call is missed because of an expired timeout
error :: Error
}
deriving (Show, Eq, Generic)
-- | Describes the exact type of a problem with a call
data CallProblem
= -- | The user heard their own voice
CallProblemEcho
{
}
| -- | The user heard background noise
CallProblemNoise
{
}
| -- | The other side kept disappearing
CallProblemInterruptions
{
}
| -- | The speech was distorted
CallProblemDistortedSpeech
{
}
| -- | The user couldn't hear the other side
CallProblemSilentLocal
{
}
| -- | The other side couldn't hear the user
CallProblemSilentRemote
{
}
| -- | The call ended unexpectedly
CallProblemDropped
{
}
deriving (Show, Eq, Generic)
data Call
= -- | Describes a call
Call
{ -- | Call identifier, not persistent
id :: I32,
-- | Peer user identifier
user_id :: I32,
-- | True, if the call is outgoing
is_outgoing :: Bool,
-- | Call state
state :: CallState
}
deriving (Show, Eq, Generic)
data PhoneNumberAuthenticationSettings
= -- | Contains settings for the authentication of the user's phone number
PhoneNumberAuthenticationSettings
{ -- | Pass true if the authentication code may be sent via flash call to the specified phone number
allow_flash_call :: Bool,
-- | Pass true if the authenticated phone number is used on the current device
is_current_phone_number :: Bool,
-- | For official applications only. True, if the app can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details
allow_sms_retriever_api :: Bool
}
deriving (Show, Eq, Generic)
data Animations
= -- | Represents a list of animations
Animations
{ -- | List of animations
animations :: [Animation]
}
deriving (Show, Eq, Generic)
data ImportedContacts
= -- | Represents the result of an ImportContacts request
ImportedContacts
{ -- | User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user
user_ids :: [I32],
-- | The number of users that imported the corresponding contact; 0 for already registered users or if unavailable
importer_count :: [I32]
}
deriving (Show, Eq, Generic)
data HttpUrl
= -- | Contains an HTTP URL
HttpUrl
{ -- | The URL
url :: T
}
deriving (Show, Eq, Generic)
-- | Represents a single result of an inline query; for bots only
data InputInlineQueryResult
= -- | Represents a link to an animated GIF or an animated (i.e. without sound) H.264/MPEG-4 AVC video
InputInlineQueryResultAnimation
{ -- | Unique identifier of the query result
id :: T,
-- | Title of the query result
title :: T,
-- | URL of the result thumbnail (JPEG, GIF, or MPEG4), if it exists
thumbnail_url :: T,
-- | MIME type of the video thumbnail. If non-empty, must be one of "image/jpeg", "image/gif" and "video/mp4"
thumbnail_mime_type :: T,
-- | The URL of the video file (file size must not exceed 1MB)
video_url :: T,
-- | MIME type of the video file. Must be one of "image/gif" and "video/mp4"
video_mime_type :: T,
-- | Duration of the video, in seconds
video_duration :: I32,
-- | Width of the video
video_width :: I32,
-- | Height of the video
video_height :: I32,
-- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
reply_markup :: ReplyMarkup,
-- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageAnimation, InputMessageLocation, InputMessageVenue or InputMessageContact
input_message_content :: InputMessageContent
}
| -- | Represents a link to an article or web page
InputInlineQueryResultArticle
{ -- | Unique identifier of the query result
id :: T,
-- | URL of the result, if it exists
url :: T,
-- | True, if the URL must be not shown
hide_url :: Bool,
-- | Title of the result
title :: T,
-- | Represents a link to an article or web page
description :: T,
-- | URL of the result thumbnail, if it exists
thumbnail_url :: T,
-- | Thumbnail width, if known
thumbnail_width :: I32,
-- | Thumbnail height, if known
thumbnail_height :: I32,
-- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
reply_markup :: ReplyMarkup,
-- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact
input_message_content :: InputMessageContent
}
| -- | Represents a link to an MP3 audio file
InputInlineQueryResultAudio
{ -- | Unique identifier of the query result
id :: T,
-- | Title of the audio file
title :: T,
-- | Performer of the audio file
performer :: T,
-- | The URL of the audio file
audio_url :: T,
-- | Audio file duration, in seconds
audio_duration :: I32,
-- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
reply_markup :: ReplyMarkup,
-- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageAudio, InputMessageLocation, InputMessageVenue or InputMessageContact
input_message_content :: InputMessageContent
}
| -- | Represents a user contact
InputInlineQueryResultContact
{ -- | Unique identifier of the query result
id :: T,
-- | User contact
contact :: Contact,
-- | URL of the result thumbnail, if it exists
thumbnail_url :: T,
-- | Thumbnail width, if known
thumbnail_width :: I32,
-- | Thumbnail height, if known
thumbnail_height :: I32,
-- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
reply_markup :: ReplyMarkup,
-- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact
input_message_content :: InputMessageContent
}
| -- | Represents a link to a file
InputInlineQueryResultDocument
{ -- | Unique identifier of the query result
id :: T,
-- | Title of the resulting file
title :: T,
-- | Represents a link to a file
description :: T,
-- | URL of the file
document_url :: T,
-- | MIME type of the file content; only "application/pdf" and "application/zip" are currently allowed
mime_type :: T,
-- | The URL of the file thumbnail, if it exists
thumbnail_url :: T,
-- | Width of the thumbnail
thumbnail_width :: I32,
-- | Height of the thumbnail
thumbnail_height :: I32,
-- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
reply_markup :: ReplyMarkup,
-- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageDocument, InputMessageLocation, InputMessageVenue or InputMessageContact
input_message_content :: InputMessageContent
}
| -- | Represents a game
InputInlineQueryResultGame
{ -- | Unique identifier of the query result
id :: T,
-- | Short name of the game
game_short_name :: T,
-- | Message reply markup. Must be of type replyMarkupInlineKeyboard or null
reply_markup :: ReplyMarkup
}
| -- | Represents a point on the map
InputInlineQueryResultLocation
{ -- | Unique identifier of the query result
id :: T,
-- | Location result
location :: Location,
-- | Amount of time relative to the message sent time until the location can be updated, in seconds
live_period :: I32,
-- | Title of the result
title :: T,
-- | URL of the result thumbnail, if it exists
thumbnail_url :: T,
-- | Thumbnail width, if known
thumbnail_width :: I32,
-- | Thumbnail height, if known
thumbnail_height :: I32,
-- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
reply_markup :: ReplyMarkup,
-- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact
input_message_content :: InputMessageContent
}
| -- | Represents link to a JPEG image
InputInlineQueryResultPhoto
{ -- | Unique identifier of the query result
id :: T,
-- | Title of the result, if known
title :: T,
-- | Represents link to a JPEG image
description :: T,
-- | URL of the photo thumbnail, if it exists
thumbnail_url :: T,
-- | The URL of the JPEG photo (photo size must not exceed 5MB)
photo_url :: T,
-- | Width of the photo
photo_width :: I32,
-- | Height of the photo
photo_height :: I32,
-- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
reply_markup :: ReplyMarkup,
-- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessagePhoto, InputMessageLocation, InputMessageVenue or InputMessageContact
input_message_content :: InputMessageContent
}
| -- | Represents a link to a WEBP or TGS sticker
InputInlineQueryResultSticker
{ -- | Unique identifier of the query result
id :: T,
-- | URL of the sticker thumbnail, if it exists
thumbnail_url :: T,
-- | The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB)
sticker_url :: T,
-- | Width of the sticker
sticker_width :: I32,
-- | Height of the sticker
sticker_height :: I32,
-- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
reply_markup :: ReplyMarkup,
-- | The content of the message to be sent. Must be one of the following types: InputMessageText, inputMessageSticker, InputMessageLocation, InputMessageVenue or InputMessageContact
input_message_content :: InputMessageContent
}
| -- | Represents information about a venue
InputInlineQueryResultVenue
{ -- | Unique identifier of the query result
id :: T,
-- | Venue result
venue :: Venue,
-- | URL of the result thumbnail, if it exists
thumbnail_url :: T,
-- | Thumbnail width, if known
thumbnail_width :: I32,
-- | Thumbnail height, if known
thumbnail_height :: I32,
-- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
reply_markup :: ReplyMarkup,
-- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact
input_message_content :: InputMessageContent
}
| -- | Represents a link to a page containing an embedded video player or a video file
InputInlineQueryResultVideo
{ -- | Unique identifier of the query result
id :: T,
-- | Title of the result
title :: T,
-- | Represents a link to a page containing an embedded video player or a video file
description :: T,
-- | The URL of the video thumbnail (JPEG), if it exists
thumbnail_url :: T,
-- | URL of the embedded video player or video file
video_url :: T,
-- | MIME type of the content of the video URL, only "text/html" or "video/mp4" are currently supported
mime_type :: T,
-- | Width of the video
video_width :: I32,
-- | Height of the video
video_height :: I32,
-- | Video duration, in seconds
video_duration :: I32,
-- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
reply_markup :: ReplyMarkup,
-- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageVideo, InputMessageLocation, InputMessageVenue or InputMessageContact
input_message_content :: InputMessageContent
}
| -- | Represents a link to an opus-encoded audio file within an OGG container, single channel audio
InputInlineQueryResultVoiceNote
{ -- | Unique identifier of the query result
id :: T,
-- | Title of the voice note
title :: T,
-- | The URL of the voice note file
voice_note_url :: T,
-- | Duration of the voice note, in seconds
voice_note_duration :: I32,
-- | The message reply markup. Must be of type replyMarkupInlineKeyboard or null
reply_markup :: ReplyMarkup,
-- | The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue or InputMessageContact
input_message_content :: InputMessageContent
}
deriving (Show, Eq, Generic)
-- | Represents a single result of an inline query
data InlineQueryResult
= -- | Represents a link to an article or web page
InlineQueryResultArticle
{ -- | Unique identifier of the query result
id :: T,
-- | URL of the result, if it exists
url :: T,
-- | True, if the URL must be not shown
hide_url :: Bool,
-- | Title of the result
title :: T,
-- | Represents a link to an article or web page
description :: T,
-- | Result thumbnail; may be null
thumbnail :: PhotoSize
}
| -- | Represents a user contact
InlineQueryResultContact
{ -- | Unique identifier of the query result
id :: T,
-- | A user contact
contact :: Contact,
-- | Result thumbnail; may be null
thumbnail :: PhotoSize
}
| -- | Represents a point on the map
InlineQueryResultLocation
{ -- | Unique identifier of the query result
id :: T,
-- | Location result
location :: Location,
-- | Title of the result
title :: T,
-- | Result thumbnail; may be null
thumbnail :: PhotoSize
}
| -- | Represents information about a venue
InlineQueryResultVenue
{ -- | Unique identifier of the query result
id :: T,
-- | Venue result
venue :: Venue,
-- | Result thumbnail; may be null
thumbnail :: PhotoSize
}
| -- | Represents information about a game
InlineQueryResultGame
{ -- | Unique identifier of the query result
id :: T,
-- | Game result
game :: Game
}
| -- | Represents an animation file
InlineQueryResultAnimation
{ -- | Unique identifier of the query result
id :: T,
-- | Animation file
animation :: Animation,
-- | Animation title
title :: T
}
| -- | Represents an audio file
InlineQueryResultAudio
{ -- | Unique identifier of the query result
id :: T,
-- | Audio file
audio :: Audio
}
| -- | Represents a document
InlineQueryResultDocument
{ -- | Unique identifier of the query result
id :: T,
-- | Document
document :: Document,
-- | Document title
title :: T,
-- | Represents a document
description :: T
}
| -- | Represents a photo
InlineQueryResultPhoto
{ -- | Unique identifier of the query result
id :: T,
-- | Photo
photo :: Photo,
-- | Title of the result, if known
title :: T,
-- | Represents a photo
description :: T
}
| -- | Represents a sticker
InlineQueryResultSticker
{ -- | Unique identifier of the query result
id :: T,
-- | Sticker
sticker :: Sticker
}
| -- | Represents a video
InlineQueryResultVideo
{ -- | Unique identifier of the query result
id :: T,
-- | Video
video :: Video,
-- | Title of the video
title :: T,
-- | Represents a video
description :: T
}
| -- | Represents a voice note
InlineQueryResultVoiceNote
{ -- | Unique identifier of the query result
id :: T,
-- | Voice note
voice_note :: VoiceNote,
-- | Title of the voice note
title :: T
}
deriving (Show, Eq, Generic)
data InlineQueryResults
= -- | Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query
InlineQueryResults
{ -- | Unique identifier of the inline query
inline_query_id :: I64,
-- | The offset for the next request. If empty, there are no more results
next_offset :: T,
-- | Results of the query
results :: [InlineQueryResult],
-- | If non-empty, this text should be shown on the button, which opens a private chat with the bot and sends the bot a start message with the switch_pm_parameter
switch_pm_text :: T,
-- | Parameter for the bot start message
switch_pm_parameter :: T
}
deriving (Show, Eq, Generic)
-- | Represents a payload of a callback query
data CallbackQueryPayload
= -- | The payload from a general callback button
CallbackQueryPayloadData
{ -- | Data that was attached to the callback button
data_ :: ByteString64
}
| -- | The payload from a game callback button
CallbackQueryPayloadGame
{ -- | A short name of the game that was attached to the callback button
game_short_name :: T
}
deriving (Show, Eq, Generic)
data CallbackQueryAnswer
= -- | Contains a bot's answer to a callback query
CallbackQueryAnswer
{ -- | Text of the answer
text :: T,
-- | True, if an alert should be shown to the user instead of a toast notification
show_alert :: Bool,
-- | URL to be opened
url :: T
}
deriving (Show, Eq, Generic)
data CustomRequestResult
= -- | Contains the result of a custom request
CustomRequestResult
{ -- | A JSON-serialized result
result :: T
}
deriving (Show, Eq, Generic)
data GameHighScore
= -- | Contains one row of the game high score table
GameHighScore
{ -- | Position in the high score table
position :: I32,
-- | User identifier
user_id :: I32,
-- | User score
score :: I32
}
deriving (Show, Eq, Generic)
data GameHighScores
= -- | Contains a list of game high scores
GameHighScores
{ -- | A list of game high scores
scores :: [GameHighScore]
}
deriving (Show, Eq, Generic)
-- | Represents a chat event
data ChatEventAction
= -- | A message was edited
ChatEventMessageEdited
{ -- | The original message before the edit
old_message :: Message,
-- | The message after it was edited
new_message :: Message
}
| -- | A message was deleted
ChatEventMessageDeleted
{ -- | Deleted message
message :: Message
}
| -- | A poll in a message was stopped
ChatEventPollStopped
{ -- | The message with the poll
message :: Message
}
| -- | A message was pinned
ChatEventMessagePinned
{ -- | Pinned message
message :: Message
}
| -- | A message was unpinned
ChatEventMessageUnpinned
{
}
| -- | A new member joined the chat
ChatEventMemberJoined
{
}
| -- | A member left the chat
ChatEventMemberLeft
{
}
| -- | A new chat member was invited
ChatEventMemberInvited
{ -- | New member user identifier
user_id :: I32,
-- | New member status
status :: ChatMemberStatus
}
| -- | A chat member has gained/lost administrator status, or the list of their administrator privileges has changed
ChatEventMemberPromoted
{ -- | Chat member user identifier
user_id :: I32,
-- | Previous status of the chat member
old_status :: ChatMemberStatus,
-- | New status of the chat member
new_status :: ChatMemberStatus
}
| -- | A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed
ChatEventMemberRestricted
{ -- | Chat member user identifier
user_id :: I32,
-- | Previous status of the chat member
old_status :: ChatMemberStatus,
-- | New status of the chat member
new_status :: ChatMemberStatus
}
| -- | The chat title was changed
ChatEventTitleChanged
{ -- | Previous chat title
old_title :: T,
-- | New chat title
new_title :: T
}
| -- | The chat permissions was changed
ChatEventPermissionsChanged
{ -- | Previous chat permissions
old_permissions :: ChatPermissions,
-- | New chat permissions
new_permissions :: ChatPermissions
}
| -- | The chat description was changed
ChatEventDescriptionChanged
{ -- | Previous chat description
old_description :: T,
-- | New chat description
new_description :: T
}
| -- | The chat username was changed
ChatEventUsernameChanged
{ -- | Previous chat username
old_username :: T,
-- | New chat username
new_username :: T
}
| -- | The chat photo was changed
ChatEventPhotoChanged
{ -- | Previous chat photo value; may be null
old_photo :: Photo,
-- | New chat photo value; may be null
new_photo :: Photo
}
| -- | The can_invite_users permission of a supergroup chat was toggled
ChatEventInvitesToggled
{ -- | New value of can_invite_users permission
can_invite_users :: Bool
}
| -- | The linked chat of a supergroup was changed
ChatEventLinkedChatChanged
{ -- | Previous supergroup linked chat identifier
old_linked_chat_id :: I53,
-- | New supergroup linked chat identifier
new_linked_chat_id :: I53
}
| -- | The slow_mode_delay setting of a supergroup was changed
ChatEventSlowModeDelayChanged
{ -- | Previous value of slow_mode_delay
old_slow_mode_delay :: I32,
-- | New value of slow_mode_delay
new_slow_mode_delay :: I32
}
| -- | The sign_messages setting of a channel was toggled
ChatEventSignMessagesToggled
{ -- | New value of sign_messages
sign_messages :: Bool
}
| -- | The supergroup sticker set was changed
ChatEventStickerSetChanged
{ -- | Previous identifier of the chat sticker set; 0 if none
old_sticker_set_id :: I64,
-- | New identifier of the chat sticker set; 0 if none
new_sticker_set_id :: I64
}
| -- | The supergroup location was changed
ChatEventLocationChanged
{ -- | Previous location; may be null
old_location :: ChatLocation,
-- | New location; may be null
new_location :: ChatLocation
}
| -- | The is_all_history_available setting of a supergroup was toggled
ChatEventIsAllHistoryAvailableToggled
{ -- | New value of is_all_history_available
is_all_history_available :: Bool
}
deriving (Show, Eq, Generic)
data ChatEvent
= -- | Represents a chat event
ChatEvent
{ -- | Chat event identifier
id :: I64,
-- | Point in time (Unix timestamp) when the event happened
date :: I32,
-- | Identifier of the user who performed the action that triggered the event
user_id :: I32,
-- | Action performed by the user
action :: ChatEventAction
}
deriving (Show, Eq, Generic)
data ChatEvents
= -- | Contains a list of chat events
ChatEvents
{ -- | List of events
events :: [ChatEvent]
}
deriving (Show, Eq, Generic)
data ChatEventLogFilters
= -- | Represents a set of filters used to obtain a chat event log
ChatEventLogFilters
{ -- | True, if message edits should be returned
message_edits :: Bool,
-- | True, if message deletions should be returned
message_deletions :: Bool,
-- | True, if pin/unpin events should be returned
message_pins :: Bool,
-- | True, if members joining events should be returned
member_joins :: Bool,
-- | True, if members leaving events should be returned
member_leaves :: Bool,
-- | True, if invited member events should be returned
member_invites :: Bool,
-- | True, if member promotion/demotion events should be returned
member_promotions :: Bool,
-- | True, if member restricted/unrestricted/banned/unbanned events should be returned
member_restrictions :: Bool,
-- | True, if changes in chat information should be returned
info_changes :: Bool,
-- | True, if changes in chat settings should be returned
setting_changes :: Bool
}
deriving (Show, Eq, Generic)
-- | Represents the value of a string in a language pack
data LanguagePackStringValue
= -- | An ordinary language pack string
LanguagePackStringValueOrdinary
{ -- | String value
value :: T
}
| -- | A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info
LanguagePackStringValuePluralized
{ -- | Value for zero objects
zero_value :: T,
-- | Value for one object
one_value :: T,
-- | Value for two objects
two_value :: T,
-- | Value for few objects
few_value :: T,
-- | Value for many objects
many_value :: T,
-- | Default value
other_value :: T
}
| -- | A deleted language pack string, the value should be taken from the built-in english language pack
LanguagePackStringValueDeleted
{
}
deriving (Show, Eq, Generic)
data LanguagePackString
= -- | Represents one language pack string
LanguagePackString
{ -- | String key
key :: T,
-- | String value
value :: LanguagePackStringValue
}
deriving (Show, Eq, Generic)
data LanguagePackStrings
= -- | Contains a list of language pack strings
LanguagePackStrings
{ -- | A list of language pack strings
strings :: [LanguagePackString]
}
deriving (Show, Eq, Generic)
data LanguagePackInfo
= -- | Contains information about a language pack
LanguagePackInfo
{ -- | Unique language pack identifier
id :: T,
-- | Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it should be fetched from base language pack. Unsupported in custom language packs
base_language_pack_id :: T,
-- | Language name
name :: T,
-- | Name of the language in that language
native_name :: T,
-- | A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info
plural_code :: T,
-- | True, if the language pack is official
is_official :: Bool,
-- | True, if the language pack strings are RTL
is_rtl :: Bool,
-- | True, if the language pack is a beta language pack
is_beta :: Bool,
-- | True, if the language pack is installed by the current user
is_installed :: Bool,
-- | Total number of non-deleted strings from the language pack
total_string_count :: I32,
-- | Total number of translated strings from the language pack
translated_string_count :: I32,
-- | Total number of non-deleted strings from the language pack available locally
local_string_count :: I32,
-- | Link to language translation interface; empty for custom local language packs
translation_url :: T
}
deriving (Show, Eq, Generic)
data LocalizationTargetInfo
= -- | Contains information about the current localization target
LocalizationTargetInfo
{ -- | List of available language packs for this application
language_packs :: [LanguagePackInfo]
}
deriving (Show, Eq, Generic)
-- | Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, you must specify the correct application platform and upload valid server authentication data at https://my.telegram.org
data DeviceToken
= -- | A token for Firebase Cloud Messaging
DeviceTokenFirebaseCloudMessaging
{ -- | Device registration token; may be empty to de-register a device
token :: T,
-- | True, if push notifications should be additionally encrypted
encrypt :: Bool
}
| -- | A token for Apple Push Notification service
DeviceTokenApplePush
{ -- | Device token; may be empty to de-register a device
device_token :: T,
-- | True, if App Sandbox is enabled
is_app_sandbox :: Bool
}
| -- | A token for Apple Push Notification service VoIP notifications
DeviceTokenApplePushVoIP
{ -- | Device token; may be empty to de-register a device
device_token :: T,
-- | True, if App Sandbox is enabled
is_app_sandbox :: Bool,
-- | True, if push notifications should be additionally encrypted
encrypt :: Bool
}
| -- | A token for Windows Push Notification Services
DeviceTokenWindowsPush
{ -- | The access token that will be used to send notifications; may be empty to de-register a device
access_token :: T
}
| -- | A token for Microsoft Push Notification Service
DeviceTokenMicrosoftPush
{ -- | Push notification channel URI; may be empty to de-register a device
channel_uri :: T
}
| -- | A token for Microsoft Push Notification Service VoIP channel
DeviceTokenMicrosoftPushVoIP
{ -- | Push notification channel URI; may be empty to de-register a device
channel_uri :: T
}
| -- | A token for web Push API
DeviceTokenWebPush
{ -- | Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device
endpoint :: T,
-- | Base64url-encoded P-256 elliptic curve Diffie-Hellman public key
p256dh_base64url :: T,
-- | Base64url-encoded authentication secret
auth_base64url :: T
}
| -- | A token for Simple Push API for Firefox OS
DeviceTokenSimplePush
{ -- | Absolute URL exposed by the push service where the application server can send push messages; may be empty to de-register a device
endpoint :: T
}
| -- | A token for Ubuntu Push Client service
DeviceTokenUbuntuPush
{ -- | Token; may be empty to de-register a device
token :: T
}
| -- | A token for BlackBerry Push Service
DeviceTokenBlackBerryPush
{ -- | Token; may be empty to de-register a device
token :: T
}
| -- | A token for Tizen Push Service
DeviceTokenTizenPush
{ -- | Push service registration identifier; may be empty to de-register a device
reg_id :: T
}
deriving (Show, Eq, Generic)
data PushReceiverId
= -- | Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification
PushReceiverId
{ -- | The globally unique identifier of push notification subscription
id :: I64
}
deriving (Show, Eq, Generic)
-- | Describes a fill of a background
data BackgroundFill
= -- | Describes a solid fill of a background
BackgroundFillSolid
{ -- | A color of the background in the RGB24 format
color :: I32
}
| -- | Describes a gradient fill of a background
BackgroundFillGradient
{ -- | A top color of the background in the RGB24 format
top_color :: I32,
-- | A bottom color of the background in the RGB24 format
bottom_color :: I32,
-- | Clockwise rotation angle of the gradient, in degrees; 0-359. Should be always divisible by 45
rotation_angle :: I32
}
deriving (Show, Eq, Generic)
-- | Describes the type of a background
data BackgroundType
= -- | A wallpaper in JPEG format
BackgroundTypeWallpaper
{ -- | True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12
is_blurred :: Bool,
-- | True, if the background needs to be slightly moved when device is tilted
is_moving :: Bool
}
| -- | A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user
BackgroundTypePattern
{ -- | Description of the background fill
fill :: BackgroundFill,
-- | Intensity of the pattern when it is shown above the filled background, 0-100
intensity :: I32,
-- | True, if the background needs to be slightly moved when device is tilted
is_moving :: Bool
}
| -- | A filled background
BackgroundTypeFill
{ -- | Description of the background fill
fill :: BackgroundFill
}
deriving (Show, Eq, Generic)
data Background
= -- | Describes a chat background
Background
{ -- | Unique background identifier
id :: I64,
-- | True, if this is one of default backgrounds
is_default :: Bool,
-- | True, if the background is dark and is recommended to be used with dark theme
is_dark :: Bool,
-- | Unique background name
name :: T,
-- | Document with the background; may be null. Null only for filled backgrounds
document :: Document,
-- | Type of the background
type_ :: BackgroundType
}
deriving (Show, Eq, Generic)
data Backgrounds
= -- | Contains a list of backgrounds
Backgrounds
{ -- | A list of backgrounds
backgrounds :: [Background]
}
deriving (Show, Eq, Generic)
-- | Contains information about background to set
data InputBackground
= -- | A background from a local file
InputBackgroundLocal
{ -- | Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file must be in JPEG format for wallpapers and in PNG format for patterns
background :: InputFile
}
| -- | A background from the server
InputBackgroundRemote
{ -- | The background identifier
background_id :: I64
}
deriving (Show, Eq, Generic)
data Hashtags
= -- | Contains a list of hashtags
Hashtags
{ -- | A list of hashtags
hashtags :: [T]
}
deriving (Show, Eq, Generic)
-- | Represents result of checking whether the current session can be used to transfer a chat ownership to another user
data CanTransferOwnershipResult
= -- | The session can be used
CanTransferOwnershipResultOk
{
}
| -- | The 2-step verification needs to be enabled first
CanTransferOwnershipResultPasswordNeeded
{
}
| -- | The 2-step verification was enabled recently, user needs to wait
CanTransferOwnershipResultPasswordTooFresh
{ -- | Time left before the session can be used to transfer ownership of a chat, in seconds
retry_after :: I32
}
| -- | The session was created recently, user needs to wait
CanTransferOwnershipResultSessionTooFresh
{ -- | Time left before the session can be used to transfer ownership of a chat, in seconds
retry_after :: I32
}
deriving (Show, Eq, Generic)
-- | Represents result of checking whether a username can be set for a chat
data CheckChatUsernameResult
= -- | The username can be set
CheckChatUsernameResultOk
{
}
| -- | The username is invalid
CheckChatUsernameResultUsernameInvalid
{
}
| -- | The username is occupied
CheckChatUsernameResultUsernameOccupied
{
}
| -- | The user has too much chats with username, one of them should be made private first
CheckChatUsernameResultPublicChatsTooMuch
{
}
| -- | The user can't be a member of a public supergroup
CheckChatUsernameResultPublicGroupsUnavailable
{
}
deriving (Show, Eq, Generic)
-- | Contains content of a push message notification
data PushMessageContent
= -- | A general message with hidden content
PushMessageContentHidden
{ -- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | An animation message (GIF-style).
PushMessageContentAnimation
{ -- | Message content; may be null
animation :: Animation,
-- | Animation caption
caption :: T,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | An audio message
PushMessageContentAudio
{ -- | Message content; may be null
audio :: Audio,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A message with a user contact
PushMessageContentContact
{ -- | Contact's name
name :: T,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A contact has registered with Telegram
PushMessageContentContactRegistered
{
}
| -- | A document message (a general file)
PushMessageContentDocument
{ -- | Message content; may be null
document :: Document,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A message with a game
PushMessageContentGame
{ -- | Game title, empty for pinned game message
title :: T,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A new high score was achieved in a game
PushMessageContentGameScore
{ -- | Game title, empty for pinned message
title :: T,
-- | New score, 0 for pinned message
score :: I32,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A message with an invoice from a bot
PushMessageContentInvoice
{ -- | Product price
price :: T,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A message with a location
PushMessageContentLocation
{ -- | True, if the location is live
is_live :: Bool,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A photo message
PushMessageContentPhoto
{ -- | Message content; may be null
photo :: Photo,
-- | Photo caption
caption :: T,
-- | True, if the photo is secret
is_secret :: Bool,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A message with a poll
PushMessageContentPoll
{ -- | Poll question
question :: T,
-- | True, if the poll is regular and not in quiz mode
is_regular :: Bool,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A screenshot of a message in the chat has been taken
PushMessageContentScreenshotTaken
{
}
| -- | A message with a sticker
PushMessageContentSticker
{ -- | Message content; may be null
sticker :: Sticker,
-- | Emoji corresponding to the sticker; may be empty
emoji :: T,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A text message
PushMessageContentText
{ -- | Message text
text :: T,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A video message
PushMessageContentVideo
{ -- | Message content; may be null
video :: Video,
-- | Video caption
caption :: T,
-- | True, if the video is secret
is_secret :: Bool,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A video note message
PushMessageContentVideoNote
{ -- | Message content; may be null
video_note :: VideoNote,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A voice note message
PushMessageContentVoiceNote
{ -- | Message content; may be null
voice_note :: VoiceNote,
-- | True, if the message is a pinned message with the specified content
is_pinned :: Bool
}
| -- | A newly created basic group
PushMessageContentBasicGroupChatCreate
{
}
| -- | New chat members were invited to a group
PushMessageContentChatAddMembers
{ -- | Name of the added member
member_name :: T,
-- | True, if the current user was added to the group
is_current_user :: Bool,
-- | True, if the user has returned to the group themself
is_returned :: Bool
}
| -- | A chat photo was edited
PushMessageContentChatChangePhoto
{
}
| -- | A chat title was edited
PushMessageContentChatChangeTitle
{ -- | New chat title
title :: T
}
| -- | A chat member was deleted
PushMessageContentChatDeleteMember
{ -- | Name of the deleted member
member_name :: T,
-- | True, if the current user was deleted from the group
is_current_user :: Bool,
-- | True, if the user has left the group themself
is_left :: Bool
}
| -- | A new member joined the chat by invite link
PushMessageContentChatJoinByLink
{
}
| -- | A forwarded messages
PushMessageContentMessageForwards
{ -- | Number of forwarded messages
total_count :: I32
}
| -- | A media album
PushMessageContentMediaAlbum
{ -- | Number of messages in the album
total_count :: I32,
-- | True, if the album has at least one photo
has_photos :: Bool,
-- | True, if the album has at least one video
has_videos :: Bool
}
deriving (Show, Eq, Generic)
-- | Contains detailed information about a notification
data NotificationType
= -- | New message was received
NotificationTypeNewMessage
{ -- | The message
message :: Message
}
| -- | New secret chat was created
NotificationTypeNewSecretChat
{
}
| -- | New call was received
NotificationTypeNewCall
{ -- | Call identifier
call_id :: I32
}
| -- | New message was received through a push notification
NotificationTypeNewPushMessage
{ -- | The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages and as reply_to_message_id
message_id :: I53,
-- | Sender of the message; 0 if unknown. Corresponding user may be inaccessible
sender_user_id :: I32,
-- | Name of the sender; can be different from the name of the sender user
sender_name :: T,
-- | True, if the message is outgoing
is_outgoing :: Bool,
-- | Push message content
content :: PushMessageContent
}
deriving (Show, Eq, Generic)
-- | Describes the type of notifications in a notification group
data NotificationGroupType
= -- | A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with ordinary unread messages
NotificationGroupTypeMessages
{
}
| -- | A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with unread mentions of the current user, replies to their messages, or a pinned message
NotificationGroupTypeMentions
{
}
| -- | A group containing a notification of type notificationTypeNewSecretChat
NotificationGroupTypeSecretChat
{
}
| -- | A group containing notifications of type notificationTypeNewCall
NotificationGroupTypeCalls
{
}
deriving (Show, Eq, Generic)
data Notification
= -- | Contains information about a notification
Notification
{ -- | Unique persistent identifier of this notification
id :: I32,
-- | Notification date
date :: I32,
-- | True, if the notification was initially silent
is_silent :: Bool,
-- | Notification type
type_ :: NotificationType
}
deriving (Show, Eq, Generic)
data NotificationGroup
= -- | Describes a group of notifications
NotificationGroup
{ -- | Unique persistent auto-incremented from 1 identifier of the notification group
id :: I32,
-- | Type of the group
type_ :: NotificationGroupType,
-- | Identifier of a chat to which all notifications in the group belong
chat_id :: I53,
-- | Total number of active notifications in the group
total_count :: I32,
-- | The list of active notifications
notifications :: [Notification]
}
deriving (Show, Eq, Generic)
-- | Represents the value of an option
data OptionValue
= -- | Represents a boolean option
OptionValueBoolean
{ -- | The value of the option
value_3 :: Bool
}
| -- | Represents an unknown option or an option which has a default value
OptionValueEmpty
{
}
| -- | Represents an integer option
OptionValueInteger
{ -- | The value of the option
value_2 :: I32
}
| -- | Represents a string option
OptionValueString
{ -- | The value of the option
value :: T
}
deriving (Show, Eq, Generic)
data JsonObjectMember
= -- | Represents one member of a JSON object
JsonObjectMember
{ -- | Member's key
key :: T,
-- | Member's value
value :: JsonValue
}
deriving (Show, Eq, Generic)
-- | Represents a JSON value
data JsonValue
= -- | Represents a null JSON value
JsonValueNull
{
}
| -- | Represents a boolean JSON value
JsonValueBoolean
{ -- | The value
value_3 :: Bool
}
| -- | Represents a numeric JSON value
JsonValueNumber
{ -- | The value
value_2 :: Double
}
| -- | Represents a string JSON value
JsonValueString
{ -- | The value
value :: T
}
| -- | Represents a JSON array
JsonValueArray
{ -- | The list of array elements
values :: [JsonValue]
}
| -- | Represents a JSON object
JsonValueObject
{ -- | The list of object members
members :: [JsonObjectMember]
}
deriving (Show, Eq, Generic)
-- | Represents a single rule for managing privacy settings
data UserPrivacySettingRule
= -- | A rule to allow all users to do something
UserPrivacySettingRuleAllowAll
{
}
| -- | A rule to allow all of a user's contacts to do something
UserPrivacySettingRuleAllowContacts
{
}
| -- | A rule to allow certain specified users to do something
UserPrivacySettingRuleAllowUsers
{ -- | The user identifiers, total number of users in all rules must not exceed 1000
user_ids :: [I32]
}
| -- | A rule to allow all members of certain specified basic groups and supergroups to doing something
UserPrivacySettingRuleAllowChatMembers
{ -- | The chat identifiers, total number of chats in all rules must not exceed 20
chat_ids :: [I53]
}
| -- | A rule to restrict all users from doing something
UserPrivacySettingRuleRestrictAll
{
}
| -- | A rule to restrict all contacts of a user from doing something
UserPrivacySettingRuleRestrictContacts
{
}
| -- | A rule to restrict all specified users from doing something
UserPrivacySettingRuleRestrictUsers
{ -- | The user identifiers, total number of users in all rules must not exceed 1000
user_ids :: [I32]
}
| -- | A rule to restrict all members of specified basic groups and supergroups from doing something
UserPrivacySettingRuleRestrictChatMembers
{ -- | The chat identifiers, total number of chats in all rules must not exceed 20
chat_ids :: [I53]
}
deriving (Show, Eq, Generic)
data UserPrivacySettingRules
= -- | A list of privacy rules. Rules are matched in the specified order. The first matched rule defines the privacy setting for a given user. If no rule matches, the action is not allowed
UserPrivacySettingRules
{ -- | A list of rules
rules :: [UserPrivacySettingRule]
}
deriving (Show, Eq, Generic)
-- | Describes available user privacy settings
data UserPrivacySetting
= -- | A privacy setting for managing whether the user's online status is visible
UserPrivacySettingShowStatus
{
}
| -- | A privacy setting for managing whether the user's profile photo is visible
UserPrivacySettingShowProfilePhoto
{
}
| -- | A privacy setting for managing whether a link to the user's account is included in forwarded messages
UserPrivacySettingShowLinkInForwardedMessages
{
}
| -- | A privacy setting for managing whether the user's phone number is visible
UserPrivacySettingShowPhoneNumber
{
}
| -- | A privacy setting for managing whether the user can be invited to chats
UserPrivacySettingAllowChatInvites
{
}
| -- | A privacy setting for managing whether the user can be called
UserPrivacySettingAllowCalls
{
}
| -- | A privacy setting for managing whether peer-to-peer connections can be used for calls
UserPrivacySettingAllowPeerToPeerCalls
{
}
| -- | A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to "Allow contacts" or "Allow all"
UserPrivacySettingAllowFindingByPhoneNumber
{
}
deriving (Show, Eq, Generic)
data AccountTtl
= -- | Contains information about the period of inactivity after which the current user's account will automatically be deleted
AccountTtl
{ -- | Number of days of inactivity before the account will be flagged for deletion; should range from 30-366 days
days :: I32
}
deriving (Show, Eq, Generic)
data Session
= -- | Contains information about one session in a Telegram application used by the current user. Sessions should be shown to the user in the returned order
Session
{ -- | Session identifier
id :: I64,
-- | True, if this session is the current session
is_current :: Bool,
-- | True, if a password is needed to complete authorization of the session
is_password_pending :: Bool,
-- | Telegram API identifier, as provided by the application
api_id :: I32,
-- | Name of the application, as provided by the application
application_name :: T,
-- | The version of the application, as provided by the application
application_version :: T,
-- | True, if the application is an official application or uses the api_id of an official application
is_official_application :: Bool,
-- | Model of the device the application has been run or is running on, as provided by the application
device_model :: T,
-- | Operating system the application has been run or is running on, as provided by the application
platform :: T,
-- | Version of the operating system the application has been run or is running on, as provided by the application
system_version :: T,
-- | Point in time (Unix timestamp) when the user has logged in
log_in_date :: I32,
-- | Point in time (Unix timestamp) when the session was last used
last_active_date :: I32,
-- | IP address from which the session was created, in human-readable format
ip :: T,
-- | A two-letter country code for the country from which the session was created, based on the IP address
country :: T,
-- | Region code from which the session was created, based on the IP address
region :: T
}
deriving (Show, Eq, Generic)
data Sessions
= -- | Contains a list of sessions
Sessions
{ -- | List of sessions
sessions :: [Session]
}
deriving (Show, Eq, Generic)
data ConnectedWebsite
= -- | Contains information about one website the current user is logged in with Telegram
ConnectedWebsite
{ -- | Website identifier
id :: I64,
-- | The domain name of the website
domain_name :: T,
-- | User identifier of a bot linked with the website
bot_user_id :: I32,
-- | The version of a browser used to log in
browser :: T,
-- | Operating system the browser is running on
platform :: T,
-- | Point in time (Unix timestamp) when the user was logged in
log_in_date :: I32,
-- | Point in time (Unix timestamp) when obtained authorization was last used
last_active_date :: I32,
-- | IP address from which the user was logged in, in human-readable format
ip :: T,
-- | Human-readable description of a country and a region, from which the user was logged in, based on the IP address
location :: T
}
deriving (Show, Eq, Generic)
data ConnectedWebsites
= -- | Contains a list of websites the current user is logged in with Telegram
ConnectedWebsites
{ -- | List of connected websites
websites :: [ConnectedWebsite]
}
deriving (Show, Eq, Generic)
-- | Describes the reason why a chat is reported
data ChatReportReason
= -- | The chat contains spam messages
ChatReportReasonSpam
{
}
| -- | The chat promotes violence
ChatReportReasonViolence
{
}
| -- | The chat contains pornographic messages
ChatReportReasonPornography
{
}
| -- | The chat has child abuse related content
ChatReportReasonChildAbuse
{
}
| -- | The chat contains copyrighted content
ChatReportReasonCopyright
{
}
| -- | The location-based chat is unrelated to its stated location
ChatReportReasonUnrelatedLocation
{
}
| -- | A custom reason provided by the user
ChatReportReasonCustom
{ -- | Report text
text :: T
}
deriving (Show, Eq, Generic)
data PublicMessageLink
= -- | Contains a public HTTPS link to a message in a supergroup or channel with a username
PublicMessageLink
{ -- | Message link
link :: T,
-- | HTML-code for embedding the message
html :: T
}
deriving (Show, Eq, Generic)
data MessageLinkInfo
= -- | Contains information about a link to a message in a chat
MessageLinkInfo
{ -- | True, if the link is a public link for a message in a chat
is_public :: Bool,
-- | If found, identifier of the chat to which the message belongs, 0 otherwise
chat_id :: I53,
-- | If found, the linked message; may be null
message :: Message,
-- | True, if the whole media album to which the message belongs is linked
for_album :: Bool
}
deriving (Show, Eq, Generic)
data FilePart
= -- | Contains a part of a file
FilePart
{ -- | File bytes
data_ :: ByteString64
}
deriving (Show, Eq, Generic)
-- | Represents the type of a file
data FileType
= -- | The data is not a file
FileTypeNone
{
}
| -- | The file is an animation
FileTypeAnimation
{
}
| -- | The file is an audio file
FileTypeAudio
{
}
| -- | The file is a document
FileTypeDocument
{
}
| -- | The file is a photo
FileTypePhoto
{
}
| -- | The file is a profile photo
FileTypeProfilePhoto
{
}
| -- | The file was sent to a secret chat (the file type is not known to the server)
FileTypeSecret
{
}
| -- | The file is a thumbnail of a file from a secret chat
FileTypeSecretThumbnail
{
}
| -- | The file is a file from Secure storage used for storing Telegram Passport files
FileTypeSecure
{
}
| -- | The file is a sticker
FileTypeSticker
{
}
| -- | The file is a thumbnail of another file
FileTypeThumbnail
{
}
| -- | The file type is not yet known
FileTypeUnknown
{
}
| -- | The file is a video
FileTypeVideo
{
}
| -- | The file is a video note
FileTypeVideoNote
{
}
| -- | The file is a voice note
FileTypeVoiceNote
{
}
| -- | The file is a wallpaper or a background pattern
FileTypeWallpaper
{
}
deriving (Show, Eq, Generic)
data StorageStatisticsByFileType
= -- | Contains the storage usage statistics for a specific file type
StorageStatisticsByFileType
{ -- | File type
file_type :: FileType,
-- | Total size of the files
size :: I53,
-- | Total number of files
count :: I32
}
deriving (Show, Eq, Generic)
data StorageStatisticsByChat
= -- | Contains the storage usage statistics for a specific chat
StorageStatisticsByChat
{ -- | Chat identifier; 0 if none
chat_id :: I53,
-- | Total size of the files in the chat
size :: I53,
-- | Total number of files in the chat
count :: I32,
-- | Statistics split by file types
by_file_type :: [StorageStatisticsByFileType]
}
deriving (Show, Eq, Generic)
data StorageStatistics
= -- | Contains the exact storage usage statistics split by chats and file type
StorageStatistics
{ -- | Total size of files
size :: I53,
-- | Total number of files
count :: I32,
-- | Statistics split by chats
by_chat :: [StorageStatisticsByChat]
}
deriving (Show, Eq, Generic)
data StorageStatisticsFast
= -- | Contains approximate storage usage statistics, excluding files of unknown file type
StorageStatisticsFast
{ -- | Approximate total size of files
files_size :: I53,
-- | Approximate number of files
file_count :: I32,
-- | Size of the database
database_size :: I53,
-- | Size of the language pack database
language_pack_database_size :: I53,
-- | Size of the TDLib internal log
log_size :: I53
}
deriving (Show, Eq, Generic)
data DatabaseStatistics
= -- | Contains database statistics
DatabaseStatistics
{ -- | Database statistics in an unspecified human-readable format
statistics :: T
}
deriving (Show, Eq, Generic)
-- | Represents the type of a network
data NetworkType
= -- | The network is not available
NetworkTypeNone
{
}
| -- | A mobile network
NetworkTypeMobile
{
}
| -- | A mobile roaming network
NetworkTypeMobileRoaming
{
}
| -- | A Wi-Fi network
NetworkTypeWiFi
{
}
| -- | A different network type (e.g., Ethernet network)
NetworkTypeOther
{
}
deriving (Show, Eq, Generic)
-- | Contains statistics about network usage
data NetworkStatisticsEntry
= -- | Contains information about the total amount of data that was used to send and receive files
NetworkStatisticsEntryFile
{ -- | Type of the file the data is part of
file_type :: FileType,
-- | Type of the network the data was sent through. Call setNetworkType to maintain the actual network type
network_type :: NetworkType,
-- | Total number of bytes sent
sent_bytes :: I53,
-- | Total number of bytes received
received_bytes :: I53
}
| -- | Contains information about the total amount of data that was used for calls
NetworkStatisticsEntryCall
{ -- | Type of the network the data was sent through. Call setNetworkType to maintain the actual network type
network_type :: NetworkType,
-- | Total number of bytes sent
sent_bytes :: I53,
-- | Total number of bytes received
received_bytes :: I53,
-- | Total call duration, in seconds
duration :: Double
}
deriving (Show, Eq, Generic)
data NetworkStatistics
= -- | A full list of available network statistic entries
NetworkStatistics
{ -- | Point in time (Unix timestamp) when the app began collecting statistics
since_date :: I32,
-- | Network statistics entries
entries :: [NetworkStatisticsEntry]
}
deriving (Show, Eq, Generic)
data AutoDownloadSettings
= -- | Contains auto-download settings
AutoDownloadSettings
{ -- | True, if the auto-download is enabled
is_auto_download_enabled :: Bool,
-- | The maximum size of a photo file to be auto-downloaded
max_photo_file_size :: I32,
-- | The maximum size of a video file to be auto-downloaded
max_video_file_size :: I32,
-- | The maximum size of other file types to be auto-downloaded
max_other_file_size :: I32,
-- | The maximum suggested bitrate for uploaded videos
video_upload_bitrate :: I32,
-- | True, if the beginning of videos needs to be preloaded for instant playback
preload_large_videos :: Bool,
-- | True, if the next audio track needs to be preloaded while the user is listening to an audio file
preload_next_audio :: Bool,
-- | True, if "use less data for calls" option needs to be enabled
use_less_data_for_calls :: Bool
}
deriving (Show, Eq, Generic)
data AutoDownloadSettingsPresets
= -- | Contains auto-download settings presets for the user
AutoDownloadSettingsPresets
{ -- | Preset with lowest settings; supposed to be used by default when roaming
low :: AutoDownloadSettings,
-- | Preset with medium settings; supposed to be used by default when using mobile data
medium :: AutoDownloadSettings,
-- | Preset with highest settings; supposed to be used by default when connected on Wi-Fi
high :: AutoDownloadSettings
}
deriving (Show, Eq, Generic)
-- | Describes the current state of the connection to Telegram servers
data ConnectionState
= -- | Currently waiting for the network to become available. Use setNetworkType to change the available network type
ConnectionStateWaitingForNetwork
{
}
| -- | Currently establishing a connection with a proxy server
ConnectionStateConnectingToProxy
{
}
| -- | Currently establishing a connection to the Telegram servers
ConnectionStateConnecting
{
}
| -- | Downloading data received while the client was offline
ConnectionStateUpdating
{
}
| -- | There is a working connection to the Telegram servers
ConnectionStateReady
{
}
deriving (Show, Eq, Generic)
-- | Represents the categories of chats for which a list of frequently used chats can be retrieved
data TopChatCategory
= -- | A category containing frequently used private chats with non-bot users
TopChatCategoryUsers
{
}
| -- | A category containing frequently used private chats with bot users
TopChatCategoryBots
{
}
| -- | A category containing frequently used basic groups and supergroups
TopChatCategoryGroups
{
}
| -- | A category containing frequently used channels
TopChatCategoryChannels
{
}
| -- | A category containing frequently used chats with inline bots sorted by their usage in inline mode
TopChatCategoryInlineBots
{
}
| -- | A category containing frequently used chats used for calls
TopChatCategoryCalls
{
}
| -- | A category containing frequently used chats used to forward messages
TopChatCategoryForwardChats
{
}
deriving (Show, Eq, Generic)
-- | Describes the type of a URL linking to an internal Telegram entity
data TMeUrlType
= -- | A URL linking to a user
TMeUrlTypeUser
{ -- | Identifier of the user
user_id :: I32
}
| -- | A URL linking to a public supergroup or channel
TMeUrlTypeSupergroup
{ -- | Identifier of the supergroup or channel
supergroup_id :: I53
}
| -- | A chat invite link
TMeUrlTypeChatInvite
{ -- | Chat invite link info
info :: ChatInviteLinkInfo
}
| -- | A URL linking to a sticker set
TMeUrlTypeStickerSet
{ -- | Identifier of the sticker set
sticker_set_id :: I64
}
deriving (Show, Eq, Generic)
data TMeUrl
= -- | Represents a URL linking to an internal Telegram entity
TMeUrl
{ -- | URL
url :: T,
-- | Type of the URL
type_ :: TMeUrlType
}
deriving (Show, Eq, Generic)
data TMeUrls
= -- | Contains a list of t.me URLs
TMeUrls
{ -- | List of URLs
urls :: [TMeUrl]
}
deriving (Show, Eq, Generic)
data Count
= -- | Contains a counter
Count
{ -- | Count
count :: I32
}
deriving (Show, Eq, Generic)
data Text
= -- | Contains some text
Text
{ -- | Text
text :: T
}
deriving (Show, Eq, Generic)
data Seconds
= -- | Contains a value representing a number of seconds
Seconds
{ -- | Number of seconds
seconds :: Double
}
deriving (Show, Eq, Generic)
data DeepLinkInfo
= -- | Contains information about a tg:// deep link
DeepLinkInfo
{ -- | Text to be shown to the user
text :: FormattedText,
-- | True, if user should be asked to update the application
need_update_application :: Bool
}
deriving (Show, Eq, Generic)
-- | Describes the way the text should be parsed for TextEntities
data TextParseMode
= -- | The text uses Markdown-style formatting
TextParseModeMarkdown
{ -- | Version of the parser: 0 or 1 - Telegram Bot API "Markdown" parse mode, 2 - Telegram Bot API "MarkdownV2" parse mode
version :: I32
}
| -- | The text uses HTML-style formatting. The same as Telegram Bot API "HTML" parse mode
TextParseModeHTML
{
}
deriving (Show, Eq, Generic)
-- | Describes the type of a proxy server
data ProxyType
= -- | A SOCKS5 proxy server
ProxyTypeSocks5
{ -- | Username for logging in; may be empty
username :: T,
-- | Password for logging in; may be empty
password :: T
}
| -- | A HTTP transparent proxy server
ProxyTypeHttp
{ -- | Username for logging in; may be empty
username :: T,
-- | Password for logging in; may be empty
password :: T,
-- | Pass true if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method
http_only :: Bool
}
| -- | An MTProto proxy server
ProxyTypeMtproto
{ -- | The proxy's secret in hexadecimal encoding
secret :: T
}
deriving (Show, Eq, Generic)
data Proxy
= -- | Contains information about a proxy server
Proxy
{ -- | Unique identifier of the proxy
id :: I32,
-- | Proxy server IP address
server :: T,
-- | Proxy server port
port :: I32,
-- | Point in time (Unix timestamp) when the proxy was last used; 0 if never
last_used_date :: I32,
-- | True, if the proxy is enabled now
is_enabled :: Bool,
-- | Type of the proxy
type_ :: ProxyType
}
deriving (Show, Eq, Generic)
data Proxies
= -- | Represents a list of proxy servers
Proxies
{ -- | List of proxy servers
proxies :: [Proxy]
}
deriving (Show, Eq, Generic)
-- | Describes a sticker that needs to be added to a sticker set
data InputSticker
= -- | A static sticker in PNG format, which will be converted to WEBP server-side
InputStickerStatic
{ -- | PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 square
sticker :: InputFile,
-- | Emojis corresponding to the sticker
emojis :: T,
-- | For masks, position where the mask should be placed; may be null
mask_position :: MaskPosition
}
| -- | An animated sticker in TGS format
InputStickerAnimated
{ -- | File with the animated sticker. Only local or uploaded within a week files are supported. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
sticker :: InputFile,
-- | Emojis corresponding to the sticker
emojis :: T
}
deriving (Show, Eq, Generic)
data DateRange
= -- | Represents a date range
DateRange
{ -- | Point in time (Unix timestamp) at which the date range begins
start_date :: I32,
-- | Point in time (Unix timestamp) at which the date range ends
end_date :: I32
}
deriving (Show, Eq, Generic)
data StatisticsValue
= -- | A statistics value
StatisticsValue
{ -- | The value
value :: Double,
-- | The value for the previous day
previous_value :: Double,
-- | The growth rate of the value, as a percentage
growth_rate_percentage :: Double
}
deriving (Show, Eq, Generic)
-- | Describes a statistics graph
data StatisticsGraph
= -- | A graph data
StatisticsGraphData
{ -- | Graph data in JSON format
json_data :: T,
-- | If non-empty, a token which can be used to receive a zoomed in graph
zoom_token :: T
}
| -- | The graph data to be asynchronously loaded through getChatStatisticsGraph
StatisticsGraphAsync
{ -- | The token to use for data loading
token :: T
}
| -- | An error message to be shown to the user instead of the graph
StatisticsGraphError
{ -- | The error message
error_message :: T
}
deriving (Show, Eq, Generic)
data ChatStatisticsMessageInteractionCounters
= -- | Contains statistics about interactions with a message
ChatStatisticsMessageInteractionCounters
{ -- | Message identifier
message_id :: I53,
-- | Number of times the message was viewed
view_count :: I32,
-- | Number of times the message was forwarded
forward_count :: I32
}
deriving (Show, Eq, Generic)
data ChatStatistics
= -- | A detailed statistics about a chat
ChatStatistics
{ -- | A period to which the statistics applies
period :: DateRange,
-- | Number of members in the chat
member_count :: StatisticsValue,
-- | Mean number of times the recently sent messages was viewed
mean_view_count :: StatisticsValue,
-- | Mean number of times the recently sent messages was shared
mean_share_count :: StatisticsValue,
-- | A percentage of users with enabled notifications for the chat
enabled_notifications_percentage :: Double,
-- | A graph containing number of members in the chat
member_count_graph :: StatisticsGraph,
-- | A graph containing number of members joined and left the chat
join_graph :: StatisticsGraph,
-- | A graph containing number of members muted and unmuted the chat
mute_graph :: StatisticsGraph,
-- | A graph containing number of message views in a given hour in the last two weeks
view_count_by_hour_graph :: StatisticsGraph,
-- | A graph containing number of message views per source
view_count_by_source_graph :: StatisticsGraph,
-- | A graph containing number of new member joins per source
join_by_source_graph :: StatisticsGraph,
-- | A graph containing number of users viewed chat messages per language
language_graph :: StatisticsGraph,
-- | A graph containing number of chat message views and shares
message_interaction_graph :: StatisticsGraph,
-- | A graph containing number of views of associated with the chat instant views
instant_view_interaction_graph :: StatisticsGraph,
-- | Detailed statistics about number of views and shares of recently sent messages
recent_message_interactions :: [ChatStatisticsMessageInteractionCounters]
}
deriving (Show, Eq, Generic)
-- | Contains notifications about data changes
data Update
= -- | The user authorization state has changed
UpdateAuthorizationState
{ -- | New authorization state
authorization_state :: AuthorizationState
}
| -- | A new message was received; can also be an outgoing message
UpdateNewMessage
{ -- | The new message
message :: Message
}
| -- | A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed. This update will be sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message
UpdateMessageSendAcknowledged
{ -- | The chat identifier of the sent message
chat_id :: I53,
-- | A temporary message identifier
message_id :: I53
}
| -- | A message has been successfully sent
UpdateMessageSendSucceeded
{ -- | Information about the sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change
message :: Message,
-- | The previous temporary message identifier
old_message_id :: I53
}
| -- | A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update
UpdateMessageSendFailed
{ -- | Contains information about the message which failed to send
message :: Message,
-- | The previous temporary message identifier
old_message_id :: I53,
-- | An error code
error_code :: I32,
-- | Error message
error_message :: T
}
| -- | The message content has changed
UpdateMessageContent
{ -- | Chat identifier
chat_id :: I53,
-- | Message identifier
message_id :: I53,
-- | New message content
new_content :: MessageContent
}
| -- | A message was edited. Changes in the message content will come in a separate updateMessageContent
UpdateMessageEdited
{ -- | Chat identifier
chat_id :: I53,
-- | Message identifier
message_id :: I53,
-- | Point in time (Unix timestamp) when the message was edited
edit_date :: I32,
-- | New message reply markup; may be null
reply_markup :: ReplyMarkup
}
| -- | The view count of the message has changed
UpdateMessageViews
{ -- | Chat identifier
chat_id :: I53,
-- | Message identifier
message_id :: I53,
-- | New value of the view count
views :: I32
}
| -- | The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the TTL timer for self-destructing messages
UpdateMessageContentOpened
{ -- | Chat identifier
chat_id :: I53,
-- | Message identifier
message_id :: I53
}
| -- | A message with an unread mention was read
UpdateMessageMentionRead
{ -- | Chat identifier
chat_id :: I53,
-- | Message identifier
message_id :: I53,
-- | The new number of unread mention messages left in the chat
unread_mention_count :: I32
}
| -- | A message with a live location was viewed. When the update is received, the client is supposed to update the live location
UpdateMessageLiveLocationViewed
{ -- | Identifier of the chat with the live location message
chat_id :: I53,
-- | Identifier of the message with live location
message_id :: I53
}
| -- | A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the client. The chat field changes will be reported through separate updates
UpdateNewChat
{ -- | The chat
chat :: Chat
}
| -- | The list to which the chat belongs was changed. This update is guaranteed to be sent only when chat.order == 0 and the current or the new chat list is null
UpdateChatChatList
{ -- | Chat identifier
chat_id :: I53,
-- | The new chat's chat list; may be null
chat_list :: ChatList
}
| -- | The title of a chat was changed
UpdateChatTitle
{ -- | Chat identifier
chat_id :: I53,
-- | The new chat title
title :: T
}
| -- | A chat photo was changed
UpdateChatPhoto
{ -- | Chat identifier
chat_id :: I53,
-- | The new chat photo; may be null
photo :: ChatPhoto
}
| -- | Chat permissions was changed
UpdateChatPermissions
{ -- | Chat identifier
chat_id :: I53,
-- | The new chat permissions
permissions :: ChatPermissions
}
| -- | The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case
UpdateChatLastMessage
{ -- | Chat identifier
chat_id :: I53,
-- | The new last message in the chat; may be null
last_message :: Message,
-- | New value of the chat order
order :: I64
}
| -- | The order of the chat in the chat list has changed. Instead of this update updateChatLastMessage, updateChatIsPinned, updateChatDraftMessage, or updateChatSource might be sent
UpdateChatOrder
{ -- | Chat identifier
chat_id :: I53,
-- | New value of the order
order :: I64
}
| -- | A chat was pinned or unpinned
UpdateChatIsPinned
{ -- | Chat identifier
chat_id :: I53,
-- | New value of is_pinned
is_pinned :: Bool,
-- | New value of the chat order
order :: I64
}
| -- | A chat was marked as unread or was read
UpdateChatIsMarkedAsUnread
{ -- | Chat identifier
chat_id :: I53,
-- | New value of is_marked_as_unread
is_marked_as_unread :: Bool
}
| -- | A chat's source in the chat list has changed
UpdateChatSource
{ -- | Chat identifier
chat_id :: I53,
-- | New chat's source; may be null
source :: ChatSource,
-- | New value of chat order
order :: I64
}
| -- | A chat's has_scheduled_messages field has changed
UpdateChatHasScheduledMessages
{ -- | Chat identifier
chat_id :: I53,
-- | New value of has_scheduled_messages
has_scheduled_messages :: Bool
}
| -- | The value of the default disable_notification parameter, used when a message is sent to the chat, was changed
UpdateChatDefaultDisableNotification
{ -- | Chat identifier
chat_id :: I53,
-- | The new default_disable_notification value
default_disable_notification :: Bool
}
| -- | Incoming messages were read or number of unread messages has been changed
UpdateChatReadInbox
{ -- | Chat identifier
chat_id :: I53,
-- | Identifier of the last read incoming message
last_read_inbox_message_id :: I53,
-- | The number of unread messages left in the chat
unread_count :: I32
}
| -- | Outgoing messages were read
UpdateChatReadOutbox
{ -- | Chat identifier
chat_id :: I53,
-- | Identifier of last read outgoing message
last_read_outbox_message_id :: I53
}
| -- | The chat unread_mention_count has changed
UpdateChatUnreadMentionCount
{ -- | Chat identifier
chat_id :: I53,
-- | The number of unread mention messages left in the chat
unread_mention_count :: I32
}
| -- | Notification settings for a chat were changed
UpdateChatNotificationSettings
{ -- | Chat identifier
chat_id :: I53,
-- | The new notification settings
notification_settings_2 :: ChatNotificationSettings
}
| -- | Notification settings for some type of chats were updated
UpdateScopeNotificationSettings
{ -- | Types of chats for which notification settings were updated
scope :: NotificationSettingsScope,
-- | The new notification settings
notification_settings :: ScopeNotificationSettings
}
| -- | The chat action bar was changed
UpdateChatActionBar
{ -- | Chat identifier
chat_id :: I53,
-- | The new value of the action bar; may be null
action_bar :: ChatActionBar
}
| -- | The chat pinned message was changed
UpdateChatPinnedMessage
{ -- | Chat identifier
chat_id :: I53,
-- | The new identifier of the pinned message; 0 if there is no pinned message in the chat
pinned_message_id :: I53
}
| -- | The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user
UpdateChatReplyMarkup
{ -- | Chat identifier
chat_id :: I53,
-- | Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
reply_markup_message_id :: I53
}
| -- | A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update shouldn't be applied
UpdateChatDraftMessage
{ -- | Chat identifier
chat_id :: I53,
-- | The new draft message; may be null
draft_message :: DraftMessage,
-- | New value of the chat order
order :: I64
}
| -- | The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed
UpdateChatOnlineMemberCount
{ -- | Identifier of the chat
chat_id :: I53,
-- | New number of online members in the chat, or 0 if unknown
online_member_count :: I32
}
| -- | A notification was changed
UpdateNotification
{ -- | Unique notification group identifier
notification_group_id :: I32,
-- | Changed notification
notification :: Notification
}
| -- | A list of active notifications in a notification group has changed
UpdateNotificationGroup
{ -- | Unique notification group identifier
notification_group_id :: I32,
-- | New type of the notification group
type_2 :: NotificationGroupType,
-- | Identifier of a chat to which all notifications in the group belong
chat_id :: I53,
-- | Chat identifier, which notification settings must be applied to the added notifications
notification_settings_chat_id :: I53,
-- | True, if the notifications should be shown without sound
is_silent :: Bool,
-- | Total number of unread notifications in the group, can be bigger than number of active notifications
total_count :: I32,
-- | List of added group notifications, sorted by notification ID
added_notifications :: [Notification],
-- | Identifiers of removed group notifications, sorted by notification ID
removed_notification_ids :: [I32]
}
| -- | Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update
UpdateActiveNotifications
{ -- | Lists of active notification groups
groups :: [NotificationGroup]
}
| -- | Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications
UpdateHavePendingNotifications
{ -- | True, if there are some delayed notification updates, which will be sent soon
have_delayed_notifications :: Bool,
-- | True, if there can be some yet unreceived notifications, which are being fetched from the server
have_unreceived_notifications :: Bool
}
| -- | Some messages were deleted
UpdateDeleteMessages
{ -- | Chat identifier
chat_id :: I53,
-- | Identifiers of the deleted messages
message_ids :: [I53],
-- | True, if the messages are permanently deleted by a user (as opposed to just becoming inaccessible)
is_permanent :: Bool,
-- | True, if the messages are deleted only from the cache and can possibly be retrieved again in the future
from_cache :: Bool
}
| -- | User activity in the chat has changed
UpdateUserChatAction
{ -- | Chat identifier
chat_id :: I53,
-- | Identifier of a user performing an action
user_id :: I32,
-- | The action description
action :: ChatAction
}
| -- | The user went online or offline
UpdateUserStatus
{ -- | User identifier
user_id :: I32,
-- | New status of the user
status :: UserStatus
}
| -- | Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the client
UpdateUser
{ -- | New data about the user
user :: User
}
| -- | Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the client
UpdateBasicGroup
{ -- | New data about the group
basic_group :: BasicGroup
}
| -- | Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the client
UpdateSupergroup
{ -- | New data about the supergroup
supergroup :: Supergroup
}
| -- | Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the client
UpdateSecretChat
{ -- | New data about the secret chat
secret_chat :: SecretChat
}
| -- | Some data from userFullInfo has been changed
UpdateUserFullInfo
{ -- | User identifier
user_id :: I32,
-- | New full information about the user
user_full_info :: UserFullInfo
}
| -- | Some data from basicGroupFullInfo has been changed
UpdateBasicGroupFullInfo
{ -- | Identifier of a basic group
basic_group_id :: I32,
-- | New full information about the group
basic_group_full_info :: BasicGroupFullInfo
}
| -- | Some data from supergroupFullInfo has been changed
UpdateSupergroupFullInfo
{ -- | Identifier of the supergroup or channel
supergroup_id :: I32,
-- | New full information about the supergroup
supergroup_full_info :: SupergroupFullInfo
}
| -- | Service notification from the server. Upon receiving this the client must show a popup with the content of the notification
UpdateServiceNotification
{ -- | Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" should be shown under notification; if user presses the second, all local data should be destroyed using Destroy method
type_ :: T,
-- | Notification content
content :: MessageContent
}
| -- | Information about a file was updated
UpdateFile
{ -- | New data about the file
file :: File
}
| -- | The file generation process needs to be started by the client
UpdateFileGenerationStart
{ -- | Unique identifier for the generation process
generation_id :: I64,
-- | The path to a file from which a new file is generated; may be empty
original_path :: T,
-- | The path to a file that should be created and where the new file should be generated
destination_path :: T,
-- | String specifying the conversion applied to the original file. If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which should be downloaded by the client
conversion :: T
}
| -- | File generation is no longer needed
UpdateFileGenerationStop
{ -- | Unique identifier for the generation process
generation_id :: I64
}
| -- | New call was created or information about a call was updated
UpdateCall
{ -- | New data about a call
call :: Call
}
| -- | Some privacy setting rules have been changed
UpdateUserPrivacySettingRules
{ -- | The privacy setting
setting :: UserPrivacySetting,
-- | New privacy rules
rules :: UserPrivacySettingRules
}
| -- | Number of unread messages in a chat list has changed. This update is sent only if the message database is used
UpdateUnreadMessageCount
{ -- | The chat list with changed number of unread messages
chat_list :: ChatList,
-- | Total number of unread messages
unread_count :: I32,
-- | Total number of unread messages in unmuted chats
unread_unmuted_count :: I32
}
| -- | Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used
UpdateUnreadChatCount
{ -- | The chat list with changed number of unread messages
chat_list :: ChatList,
-- | Approximate total number of chats in the chat list
total_count :: I32,
-- | Total number of unread chats
unread_count :: I32,
-- | Total number of unread unmuted chats
unread_unmuted_count :: I32,
-- | Total number of chats marked as unread
marked_as_unread_count :: I32,
-- | Total number of unmuted chats marked as unread
marked_as_unread_unmuted_count :: I32
}
| -- | An option changed its value
UpdateOption
{ -- | The option name
name :: T,
-- | The new option value
value :: OptionValue
}
| -- | A sticker set has changed
UpdateStickerSet
{ -- | The sticker set
sticker_set :: StickerSet
}
| -- | The list of installed sticker sets was updated
UpdateInstalledStickerSets
{ -- | True, if the list of installed mask sticker sets was updated
is_masks :: Bool,
-- | The new list of installed ordinary sticker sets
sticker_set_ids :: [I64]
}
| -- | The list of trending sticker sets was updated or some of them were viewed
UpdateTrendingStickerSets
{ -- | The prefix of the list of trending sticker sets with the newest trending sticker sets
sticker_sets :: StickerSets
}
| -- | The list of recently used stickers was updated
UpdateRecentStickers
{ -- | True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated
is_attached :: Bool,
-- | The new list of file identifiers of recently used stickers
sticker_ids :: [I32]
}
| -- | The list of favorite stickers was updated
UpdateFavoriteStickers
{ -- | The new list of file identifiers of favorite stickers
sticker_ids :: [I32]
}
| -- | The list of saved animations was updated
UpdateSavedAnimations
{ -- | The new list of file identifiers of saved animations
animation_ids :: [I32]
}
| -- | The selected background has changed
UpdateSelectedBackground
{ -- | True, if background for dark theme has changed
for_dark_theme :: Bool,
-- | The new selected background; may be null
background :: Background
}
| -- | Some language pack strings have been updated
UpdateLanguagePackStrings
{ -- | Localization target to which the language pack belongs
localization_target :: T,
-- | Identifier of the updated language pack
language_pack_id :: T,
-- | List of changed language pack strings
strings :: [LanguagePackString]
}
| -- | The connection state has changed
UpdateConnectionState
{ -- | The new connection state
state :: ConnectionState
}
| -- | New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method should be called with the reason "Decline ToS update"
UpdateTermsOfService
{ -- | Identifier of the terms of service
terms_of_service_id :: T,
-- | The new terms of service
terms_of_service :: TermsOfService
}
| -- | The list of users nearby has changed. The update is sent only 60 seconds after a successful searchChatsNearby request
UpdateUsersNearby
{ -- | The new list of users nearby
users_nearby :: [ChatNearby]
}
| -- | The list of supported dice emojis has changed
UpdateDiceEmojis
{ -- | The new list of supported dice emojis
emojis :: [T]
}
| -- | A new incoming inline query; for bots only
UpdateNewInlineQuery
{ -- | Unique query identifier
id :: I64,
-- | Identifier of the user who sent the query
sender_user_id :: I32,
-- | User location, provided by the client; may be null
user_location :: Location,
-- | Text of the query
query :: T,
-- | Offset of the first entry to return
offset :: T
}
| -- | The user has chosen a result of an inline query; for bots only
UpdateNewChosenInlineResult
{ -- | Identifier of the user who sent the query
sender_user_id :: I32,
-- | User location, provided by the client; may be null
user_location :: Location,
-- | Text of the query
query :: T,
-- | Identifier of the chosen result
result_id :: T,
-- | Identifier of the sent inline message, if known
inline_message_id :: T
}
| -- | A new incoming callback query; for bots only
UpdateNewCallbackQuery
{ -- | Unique query identifier
id :: I64,
-- | Identifier of the user who sent the query
sender_user_id :: I32,
-- | Identifier of the chat where the query was sent
chat_id :: I53,
-- | Identifier of the message, from which the query originated
message_id :: I53,
-- | Identifier that uniquely corresponds to the chat to which the message was sent
chat_instance :: I64,
-- | Query payload
payload :: CallbackQueryPayload
}
| -- | A new incoming callback query from a message sent via a bot; for bots only
UpdateNewInlineCallbackQuery
{ -- | Unique query identifier
id :: I64,
-- | Identifier of the user who sent the query
sender_user_id :: I32,
-- | Identifier of the inline message, from which the query originated
inline_message_id :: T,
-- | An identifier uniquely corresponding to the chat a message was sent to
chat_instance :: I64,
-- | Query payload
payload :: CallbackQueryPayload
}
| -- | A new incoming shipping query; for bots only. Only for invoices with flexible price
UpdateNewShippingQuery
{ -- | Unique query identifier
id :: I64,
-- | Identifier of the user who sent the query
sender_user_id :: I32,
-- | Invoice payload
invoice_payload_2 :: T,
-- | User shipping address
shipping_address :: Address
}
| -- | A new incoming pre-checkout query; for bots only. Contains full information about a checkout
UpdateNewPreCheckoutQuery
{ -- | Unique query identifier
id :: I64,
-- | Identifier of the user who sent the query
sender_user_id :: I32,
-- | Currency for the product price
currency :: T,
-- | Total price for the product, in the minimal quantity of the currency
total_amount :: I53,
-- | Invoice payload
invoice_payload :: ByteString64,
-- | Identifier of a shipping option chosen by the user; may be empty if not applicable
shipping_option_id :: T,
-- | Information about the order; may be null
order_info :: OrderInfo
}
| -- | A new incoming event; for bots only
UpdateNewCustomEvent
{ -- | A JSON-serialized event
event :: T
}
| -- | A new incoming query; for bots only
UpdateNewCustomQuery
{ -- | The query identifier
id :: I64,
-- | JSON-serialized query data
data_ :: T,
-- | Query timeout
timeout :: I32
}
| -- | A poll was updated; for bots only
UpdatePoll
{ -- | New data about the poll
poll :: Poll
}
| -- | A user changed the answer to a poll; for bots only
UpdatePollAnswer
{ -- | Unique poll identifier
poll_id :: I64,
-- | The user, who changed the answer to the poll
user_id :: I32,
-- | 0-based identifiers of answer options, chosen by the user
option_ids :: [I32]
}
deriving (Show, Eq, Generic)
data Updates
= -- | Contains a list of updates
Updates
{ -- | List of updates
updates :: [Update]
}
deriving (Show, Eq, Generic)
-- | Describes a stream to which TDLib internal log is written
data LogStream
= -- | The log is written to stderr or an OS specific log
LogStreamDefault
{
}
| -- | The log is written to a file
LogStreamFile
{ -- | Path to the file to where the internal TDLib log will be written
path :: T,
-- | The maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated
max_file_size :: I53
}
| -- | The log is written nowhere
LogStreamEmpty
{
}
deriving (Show, Eq, Generic)
data LogVerbosityLevel
= -- | Contains a TDLib internal log verbosity level
LogVerbosityLevel
{ -- | Log verbosity level
verbosity_level :: I32
}
deriving (Show, Eq, Generic)
data LogTags
= -- | Contains a list of available TDLib internal log tags
LogTags
{ -- | List of log tags
tags :: [T]
}
deriving (Show, Eq, Generic)
data TestInt
= -- | A simple object containing a number; for testing only
TestInt
{ -- | Number
value :: I32
}
deriving (Show, Eq, Generic)
data TestString
= -- | A simple object containing a string; for testing only
TestString
{ -- | String
value :: T
}
deriving (Show, Eq, Generic)
data TestBytes
= -- | A simple object containing a sequence of bytes; for testing only
TestBytes
{ -- | Bytes
value :: ByteString64
}
deriving (Show, Eq, Generic)
data TestVectorInt
= -- | A simple object containing a vector of numbers; for testing only
TestVectorInt
{ -- | Vector of numbers
value :: [I32]
}
deriving (Show, Eq, Generic)
data TestVectorIntObject
= -- | A simple object containing a vector of objects that hold a number; for testing only
TestVectorIntObject
{ -- | Vector of objects
value :: [TestInt]
}
deriving (Show, Eq, Generic)
data TestVectorString
= -- | A simple object containing a vector of strings; for testing only
TestVectorString
{ -- | Vector of strings
value :: [T]
}
deriving (Show, Eq, Generic)
data TestVectorStringObject
= -- | A simple object containing a vector of objects that hold a string; for testing only
TestVectorStringObject
{ -- | Vector of objects
value :: [TestString]
}
deriving (Show, Eq, Generic)
typeInstances