tdlib-types-0.3.0: Types and Functions generated from tdlib api spec
Safe HaskellNone
LanguageHaskell2010

TDLib.Generated.Functions

Description

TD API functions (methods) generated by tdlib-gen

Synopsis

Documentation

getAuthorizationState :: Member TDLib r => Sem r (Error AuthorizationState) Source #

Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state

setTdlibParameters Source #

Arguments

:: Member TDLib r 
=> TdlibParameters

Parameters

-> Sem r (Error Ok) 

Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters

checkDatabaseEncryptionKey Source #

Arguments

:: Member TDLib r 
=> ByteString64

Encryption key to check or set up

-> Sem r (Error Ok) 

Checks the database encryption key for correctness. Works only when the current authorization state is authorizationStateWaitEncryptionKey

setAuthenticationPhoneNumber Source #

Arguments

:: Member TDLib r 
=> T

The phone number of the user, in international format

-> PhoneNumberAuthenticationSettings

Settings for the authentication of the user's phone number

-> Sem r (Error Ok) 

Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber,

resendAuthenticationCode :: Member TDLib r => Sem r (Error Ok) Source #

Re-sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode and the next_code_type of the result is not null

checkAuthenticationCode Source #

Arguments

:: Member TDLib r 
=> T

The verification code received via SMS, Telegram message, phone call, or flash call

-> Sem r (Error Ok) 

Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode

requestQrCodeAuthentication Source #

Arguments

:: Member TDLib r 
=> [I32]

List of user identifiers of other users currently using the client

-> Sem r (Error Ok) 

Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber

registerUser Source #

Arguments

:: Member TDLib r 
=> T

The first name of the user; 1-64 characters

-> T

The last name of the user; 0-64 characters

-> Sem r (Error Ok) 

Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration

checkAuthenticationPassword Source #

Arguments

:: Member TDLib r 
=> T

The password to check

-> Sem r (Error Ok) 

Checks the authentication password for correctness. Works only when the current authorization state is authorizationStateWaitPassword

requestAuthenticationPasswordRecovery :: Member TDLib r => Sem r (Error Ok) Source #

Requests to send a password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword

recoverAuthenticationPassword Source #

Arguments

:: Member TDLib r 
=> T

Recovery code to check

-> Sem r (Error Ok) 

Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword

checkAuthenticationBotToken Source #

Arguments

:: Member TDLib r 
=> T

The bot token

-> Sem r (Error Ok) 

Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is authorizationStateWaitPhoneNumber. Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to log in

logOut :: Member TDLib r => Sem r (Error Ok) Source #

Closes the TDLib instance after a proper logout. Requires an available network connection. All local data will be destroyed. After the logout completes, updateAuthorizationState with authorizationStateClosed will be sent

close :: Member TDLib r => Sem r (Error Ok) Source #

Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes, updateAuthorizationState with authorizationStateClosed will be sent

destroy :: Member TDLib r => Sem r (Error Ok) Source #

Closes the TDLib instance, destroying all local data without a proper logout. The current user session will remain in the list of all active sessions. All local data will be destroyed. After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent

confirmQrCodeAuthentication Source #

Arguments

:: Member TDLib r 
=> T

A link from a QR code. The link must be scanned by the in-app camera

-> Sem r (Error Session) 

Confirms QR code authentication on another device. Returns created session on success

getCurrentState :: Member TDLib r => Sem r (Error Updates) Source #

Returns all updates needed to restore current TDLib state, i.e. all actual UpdateAuthorizationStateUpdateUserUpdateNewChat and others. This is especially useful if TDLib is run in a separate process. This is an offline method. Can be called before authorization

setDatabaseEncryptionKey Source #

Arguments

:: Member TDLib r 
=> ByteString64

New encryption key

-> Sem r (Error Ok) 

Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain

getPasswordState :: Member TDLib r => Sem r (Error PasswordState) Source #

Returns the current state of 2-step verification

setPassword Source #

Arguments

:: Member TDLib r 
=> T

Previous password of the user

-> T

New password of the user; may be empty to remove the password

-> T

New password hint; may be empty

-> Bool

Pass true if the recovery email address should be changed

-> T

New recovery email address; may be empty

-> Sem r (Error PasswordState) 

Changes the password for the user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed

getRecoveryEmailAddress Source #

Arguments

:: Member TDLib r 
=> T

The password for the current user

-> Sem r (Error RecoveryEmailAddress) 

Returns a 2-step verification recovery email address that was previously set up. This method can be used to verify a password provided by the user

setRecoveryEmailAddress :: Member TDLib r => T -> T -> Sem r (Error PasswordState) Source #

Changes the 2-step verification recovery email address of the user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed.

checkRecoveryEmailAddressCode Source #

Arguments

:: Member TDLib r 
=> T

Verification code

-> Sem r (Error PasswordState) 

Checks the 2-step verification recovery email address verification code

resendRecoveryEmailAddressCode :: Member TDLib r => Sem r (Error PasswordState) Source #

Resends the 2-step verification recovery email address verification code

requestPasswordRecovery :: Member TDLib r => Sem r (Error EmailAddressAuthenticationCodeInfo) Source #

Requests to send a password recovery code to an email address that was previously set up

recoverPassword Source #

Arguments

:: Member TDLib r 
=> T

Recovery code to check

-> Sem r (Error PasswordState) 

Recovers the password using a recovery code sent to an email address that was previously set up

createTemporaryPassword Source #

Arguments

:: Member TDLib r 
=> T

Persistent user password

-> I32

Time during which the temporary password will be valid, in seconds; should be between 60 and 86400

-> Sem r (Error TemporaryPasswordState) 

Creates a new temporary password for processing payments

getTemporaryPasswordState :: Member TDLib r => Sem r (Error TemporaryPasswordState) Source #

Returns information about the current temporary password

getMe :: Member TDLib r => Sem r (Error User) Source #

Returns the current user

getUser Source #

Arguments

:: Member TDLib r 
=> I32

User identifier

-> Sem r (Error User) 

Returns information about a user by their identifier. This is an offline request if the current user is not a bot

getUserFullInfo Source #

Arguments

:: Member TDLib r 
=> I32

User identifier

-> Sem r (Error UserFullInfo) 

Returns full information about a user by their identifier

getBasicGroup Source #

Arguments

:: Member TDLib r 
=> I32

Basic group identifier

-> Sem r (Error BasicGroup) 

Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot

getBasicGroupFullInfo Source #

Arguments

:: Member TDLib r 
=> I32

Basic group identifier

-> Sem r (Error BasicGroupFullInfo) 

Returns full information about a basic group by its identifier

getSupergroup Source #

Arguments

:: Member TDLib r 
=> I32

Supergroup or channel identifier

-> Sem r (Error Supergroup) 

Returns information about a supergroup or a channel by its identifier. This is an offline request if the current user is not a bot

getSupergroupFullInfo Source #

Arguments

:: Member TDLib r 
=> I32

Supergroup or channel identifier

-> Sem r (Error SupergroupFullInfo) 

Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute

getSecretChat Source #

Arguments

:: Member TDLib r 
=> I32

Secret chat identifier

-> Sem r (Error SecretChat) 

Returns information about a secret chat by its identifier. This is an offline request

getChat Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Sem r (Error Chat) 

Returns information about a chat by its identifier, this is an offline request if the current user is not a bot

getMessage Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat the message belongs to

-> I53

Identifier of the message to get

-> Sem r (Error Message) 

Returns information about a message

getMessageLocally Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat the message belongs to

-> I53

Identifier of the message to get

-> Sem r (Error Message) 

Returns information about a message, if it is available locally without sending network request. This is an offline request

getRepliedMessage Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat the message belongs to

-> I53

Identifier of the message reply to which get

-> Sem r (Error Message) 

Returns information about a message that is replied by given message

getChatPinnedMessage Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat the message belongs to

-> Sem r (Error Message) 

Returns information about a pinned chat message

getMessages Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat the messages belong to

-> [I53]

Identifiers of the messages to get

-> Sem r (Error Messages) 

Returns information about messages. If a message is not found, returns null on the corresponding position of the result

getFile Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the file to get

-> Sem r (Error File) 

Returns information about a file; this is an offline request

getRemoteFile Source #

Arguments

:: Member TDLib r 
=> T

Remote identifier of the file to get

-> FileType

File type, if known

-> Sem r (Error File) 

Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user.

getChats Source #

Arguments

:: Member TDLib r 
=> ChatList

The chat list in which to return chats

-> I64

Chat order to return chats from

-> I53

Chat identifier to return chats from

-> I32

The maximum number of chats to be returned. It is possible that fewer chats than the limit are returned even if the end of the list is not reached

-> Sem r (Error Chats) 

Returns an ordered list of chats in a chat list. Chats are sorted by the pair (order, chat_id) in decreasing order. (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed 64-bit number 9223372036854775807 == 2^63 - 1).

searchPublicChat Source #

Arguments

:: Member TDLib r 
=> T

Username to be resolved

-> Sem r (Error Chat) 

Searches a public chat by its username. Currently only private chats, supergroups and channels can be public. Returns the chat if found; otherwise an error is returned

searchPublicChats Source #

Arguments

:: Member TDLib r 
=> T

Query to search for

-> Sem r (Error Chats) 

Searches public chats by looking for specified query in their username and title. Currently only private chats, supergroups and channels can be public. Returns a meaningful number of results. Returns nothing if the length of the searched username prefix is less than 5. Excludes private chats with contacts and chats from the chat list from the results

searchChats Source #

Arguments

:: Member TDLib r 
=> T

Query to search for. If the query is empty, returns up to 20 recently found chats

-> I32

The maximum number of chats to be returned

-> Sem r (Error Chats) 

Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the chat list

searchChatsOnServer Source #

Arguments

:: Member TDLib r 
=> T

Query to search for

-> I32

The maximum number of chats to be returned

-> Sem r (Error Chats) 

Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the chat list

searchChatsNearby Source #

Arguments

:: Member TDLib r 
=> Location

Current user location

-> Sem r (Error ChatsNearby) 

Returns a list of users and location-based supergroups nearby. The list of users nearby will be updated for 60 seconds after the request by the updates updateUsersNearby. The request should be sent again every 25 seconds with adjusted location to not miss new chats

getTopChats Source #

Arguments

:: Member TDLib r 
=> TopChatCategory

Category of chats to be returned

-> I32

The maximum number of chats to be returned; up to 30

-> Sem r (Error Chats) 

Returns a list of frequently used chats. Supported only if the chat info database is enabled

removeTopChat Source #

Arguments

:: Member TDLib r 
=> TopChatCategory

Category of frequently used chats

-> I53

Chat identifier

-> Sem r (Error Ok) 

Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled

addRecentlyFoundChat Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat to add

-> Sem r (Error Ok) 

Adds a chat to the list of recently found chats. The chat is added to the beginning of the list. If the chat is already in the list, it will be removed from the list first

removeRecentlyFoundChat Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat to be removed

-> Sem r (Error Ok) 

Removes a chat from the list of recently found chats

clearRecentlyFoundChats :: Member TDLib r => Sem r (Error Ok) Source #

Clears the list of recently found chats

checkChatUsername Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier; should be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if chat is being created

-> T

Username to be checked

-> Sem r (Error CheckChatUsernameResult) 

Checks whether a username can be set for a chat

getCreatedPublicChats Source #

Arguments

:: Member TDLib r 
=> PublicChatType

Type of the public chats to return

-> Sem r (Error Chats) 

Returns a list of public chats of the specified type, owned by the user

checkCreatedPublicChatsLimit Source #

Arguments

:: Member TDLib r 
=> PublicChatType

Type of the public chats, for which to check the limit

-> Sem r (Error Ok) 

Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached

getSuitableDiscussionChats :: Member TDLib r => Sem r (Error Chats) Source #

Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Basic group chats need to be first upgraded to supergroups before they can be set as a discussion group

getInactiveSupergroupChats :: Member TDLib r => Sem r (Error Chats) Source #

Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error

getGroupsInCommon Source #

Arguments

:: Member TDLib r 
=> I32

User identifier

-> I53

Chat identifier starting from which to return chats; use 0 for the first request

-> I32

The maximum number of chats to be returned; up to 100

-> Sem r (Error Chats) 

Returns a list of common group chats with a given user. Chats are sorted by their type and creation date

getChatHistory Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> I53

Identifier of the message starting from which history must be fetched; use 0 to get results from the last message

-> I32

Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages

-> I32

The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater or equal to -offset. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached

-> Bool

If true, returns only messages that are available locally without sending network requests

-> Sem r (Error Messages) 

Returns messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id).

deleteChatHistory Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Bool

Pass true if the chat should be removed from the chat list

-> Bool

Pass true to try to delete chat history for all users

-> Sem r (Error Ok) 

Deletes all messages in the chat. Use Chat.can_be_deleted_only_for_self and Chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat

searchChatMessages Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat in which to search messages

-> T

Query to search for

-> I32

If not 0, only messages sent by the specified user will be returned. Not supported in secret chats

-> I53

Identifier of the message starting from which history must be fetched; use 0 to get results from the last message

-> I32

Specify 0 to get results from exactly the from_message_id or a negative offset to get the specified message and some newer messages

-> I32

The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached

-> SearchMessagesFilter

Filter for message content in the search results

-> Sem r (Error Messages) 

Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query

searchMessages Source #

Arguments

:: Member TDLib r 
=> ChatList

Chat list in which to search messages; pass null to search in all chats regardless of their chat list

-> T

Query to search for

-> I32

The date of the message starting from which the results should be fetched. Use 0 or any date in the future to get results from the last message

-> I53

The chat identifier of the last found message, or 0 for the first request

-> I53

The message identifier of the last found message, or 0 for the first request

-> I32

The maximum number of messages to be returned, up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached

-> Sem r (Error Messages) 

Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)).

searchSecretMessages Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat in which to search. Specify 0 to search in all secret chats

-> T

Query to search for. If empty, searchChatMessages should be used instead

-> I64

The identifier from the result of a previous request, use 0 to get results from the last message

-> I32

The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached

-> SearchMessagesFilter

A filter for the content of messages in the search results

-> Sem r (Error FoundMessages) 

Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance the number of returned messages is chosen by the library

searchCallMessages Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the message from which to search; use 0 to get results from the last message

-> I32

The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached

-> Bool

If true, returns only messages with missed calls

-> Sem r (Error Messages) 

Searches for call messages. Returns the results in reverse chronological order (i. e., in order of decreasing message_id). For optimal performance the number of returned messages is chosen by the library

searchChatRecentLocationMessages Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> I32

The maximum number of messages to be returned

-> Sem r (Error Messages) 

Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user

getActiveLiveLocationMessages :: Member TDLib r => Sem r (Error Messages) Source #

Returns all active live locations that should be updated by the client. The list is persistent across application restarts only if the message database is used

getChatMessageByDate Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> I32

Point in time (Unix timestamp) relative to which to search for messages

-> Sem r (Error Message) 

Returns the last message sent in a chat no later than the specified date

getChatMessageCount Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat in which to count messages

-> SearchMessagesFilter

Filter for message content; searchMessagesFilterEmpty is unsupported in this function

-> Bool

If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown

-> Sem r (Error Count) 

Returns approximate number of messages of the specified type in the chat

getChatScheduledMessages Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Sem r (Error Messages) 

Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)

removeNotification Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of notification group to which the notification belongs

-> I32

Identifier of removed notification

-> Sem r (Error Ok) 

Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user

removeNotificationGroup Source #

Arguments

:: Member TDLib r 
=> I32

Notification group identifier

-> I32

The maximum identifier of removed notifications

-> Sem r (Error Ok) 

Removes a group of active notifications. Needs to be called only if the notification group is removed by the current user

getPublicMessageLink Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat to which the message belongs

-> I53

Identifier of the message

-> Bool

Pass true if a link for a whole media album should be returned

-> Sem r (Error PublicMessageLink) 

Returns a public HTTPS link to a message. Available only for messages in supergroups and channels with a username

getMessageLink Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat to which the message belongs

-> I53

Identifier of the message

-> Sem r (Error HttpUrl) 

Returns a private HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels. The link will work only for members of the chat

getMessageLinkInfo Source #

Arguments

:: Member TDLib r 
=> T

The message link in the format "https://t.me/c/...", or "tg:/privatepost?...", or "https:t.meusername...", or "tg:/resolve?..."

-> Sem r (Error MessageLinkInfo) 

Returns information about a public or private message link

sendMessage Source #

Arguments

:: Member TDLib r 
=> I53

Target chat

-> I53

Identifier of the message to reply to or 0

-> SendMessageOptions

Options to be used to send the message

-> ReplyMarkup

Markup for replying to the message; for bots only

-> InputMessageContent

The content of the message to be sent

-> Sem r (Error Message) 

Sends a message. Returns the sent message

sendMessageAlbum Source #

Arguments

:: Member TDLib r 
=> I53

Target chat

-> I53

Identifier of a message to reply to or 0

-> SendMessageOptions

Options to be used to send the messages

-> [InputMessageContent]

Contents of messages to be sent

-> Sem r (Error Messages) 

Sends messages grouped together into an album. Currently only photo and video messages can be grouped into an album. Returns sent messages

sendBotStartMessage Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the bot

-> I53

Identifier of the target chat

-> T

A hidden parameter sent to the bot for deep linking purposes (https:/core.telegram.orgbots#deep-linking)

-> Sem r (Error Message) 

Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message

sendInlineQueryResultMessage Source #

Arguments

:: Member TDLib r 
=> I53

Target chat

-> I53

Identifier of a message to reply to or 0

-> SendMessageOptions

Options to be used to send the message

-> I64

Identifier of the inline query

-> T

Identifier of the inline result

-> Bool

If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username") and GetOption("venue_search_bot_username")

-> Sem r (Error Message) 

Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message

forwardMessages Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat to which to forward messages

-> I53

Identifier of the chat from which to forward messages

-> [I53]

Identifiers of the messages to forward

-> SendMessageOptions

Options to be used to send the messages

-> Bool

True, if the messages should be grouped into an album after forwarding. For this to work, no more than 10 messages may be forwarded, and all of them must be photo or video messages

-> Bool

True, if content of the messages needs to be copied without links to the original messages. Always true if the messages are forwarded to a secret chat

-> Bool

True, if media captions of message copies needs to be removed. Ignored if send_copy is false

-> Sem r (Error Messages) 

Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message

resendMessages Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat to send messages

-> [I53]

Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order

-> Sem r (Error Messages) 

Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed.

sendChatSetTtlMessage Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> I32

New TTL value, in seconds

-> Sem r (Error Message) 

Changes the current TTL setting (sets a new self-destruct timer) in a secret chat and sends the corresponding message

sendChatScreenshotTakenNotification Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Sem r (Error Ok) 

Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats

addLocalMessage Source #

Arguments

:: Member TDLib r 
=> I53

Target chat

-> I32

Identifier of the user who will be shown as the sender of the message; may be 0 for channel posts

-> I53

Identifier of the message to reply to or 0

-> Bool

Pass true to disable notification for the message

-> InputMessageContent

The content of the message to be added

-> Sem r (Error Message) 

Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message

deleteMessages Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> [I53]

Identifiers of the messages to be deleted

-> Bool

Pass true to try to delete messages for all chat members. Always true for supergroups, channels and secret chats

-> Sem r (Error Ok) 

Deletes messages

deleteChatMessagesFromUser Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> I32

User identifier

-> Sem r (Error Ok) 

Deletes all messages sent by the specified user to a chat. Supported only for supergroups; requires can_delete_messages administrator privileges

editMessageText Source #

Arguments

:: Member TDLib r 
=> I53

The chat the message belongs to

-> I53

Identifier of the message

-> ReplyMarkup

The new message reply markup; for bots only

-> InputMessageContent

New text content of the message. Should be of type InputMessageText

-> Sem r (Error Message) 

Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side

editMessageLiveLocation Source #

Arguments

:: Member TDLib r 
=> I53

The chat the message belongs to

-> I53

Identifier of the message

-> ReplyMarkup

The new message reply markup; for bots only

-> Location

New location content of the message; may be null. Pass null to stop sharing the live location

-> Sem r (Error Message) 

Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side

editMessageMedia Source #

Arguments

:: Member TDLib r 
=> I53

The chat the message belongs to

-> I53

Identifier of the message

-> ReplyMarkup

The new message reply markup; for bots only

-> InputMessageContent

New content of the message. Must be one of the following types: InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePhoto or InputMessageVideo

-> Sem r (Error Message) 

Edits the content of a message with an animation, an audio, a document, a photo or a video. The media in the message can't be replaced if the message was set to self-destruct. Media can't be replaced by self-destructing media. Media in an album can be edited only to contain a photo or a video. Returns the edited message after the edit is completed on the server side

editMessageCaption Source #

Arguments

:: Member TDLib r 
=> I53

The chat the message belongs to

-> I53

Identifier of the message

-> ReplyMarkup

The new message reply markup; for bots only

-> FormattedText

New message content caption; 0-GetOption("message_caption_length_max") characters

-> Sem r (Error Message) 

Edits the message content caption. Returns the edited message after the edit is completed on the server side

editMessageReplyMarkup Source #

Arguments

:: Member TDLib r 
=> I53

The chat the message belongs to

-> I53

Identifier of the message

-> ReplyMarkup

The new message reply markup

-> Sem r (Error Message) 

Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side

editInlineMessageText Source #

Arguments

:: Member TDLib r 
=> T

Inline message identifier

-> ReplyMarkup

The new message reply markup

-> InputMessageContent

New text content of the message. Should be of type InputMessageText

-> Sem r (Error Ok) 

Edits the text of an inline text or game message sent via a bot; for bots only

editInlineMessageLiveLocation Source #

Arguments

:: Member TDLib r 
=> T

Inline message identifier

-> ReplyMarkup

The new message reply markup

-> Location

New location content of the message; may be null. Pass null to stop sharing the live location

-> Sem r (Error Ok) 

Edits the content of a live location in an inline message sent via a bot; for bots only

editInlineMessageMedia Source #

Arguments

:: Member TDLib r 
=> T

Inline message identifier

-> ReplyMarkup

The new message reply markup; for bots only

-> InputMessageContent

New content of the message. Must be one of the following types: InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePhoto or InputMessageVideo

-> Sem r (Error Ok) 

Edits the content of a message with an animation, an audio, a document, a photo or a video in an inline message sent via a bot; for bots only

editInlineMessageCaption Source #

Arguments

:: Member TDLib r 
=> T

Inline message identifier

-> ReplyMarkup

The new message reply markup

-> FormattedText

New message content caption; 0-GetOption("message_caption_length_max") characters

-> Sem r (Error Ok) 

Edits the caption of an inline message sent via a bot; for bots only

editInlineMessageReplyMarkup Source #

Arguments

:: Member TDLib r 
=> T

Inline message identifier

-> ReplyMarkup

The new message reply markup

-> Sem r (Error Ok) 

Edits the reply markup of an inline message sent via a bot; for bots only

editMessageSchedulingState Source #

Arguments

:: Member TDLib r 
=> I53

The chat the message belongs to

-> I53

Identifier of the message

-> MessageSchedulingState

The new message scheduling state. Pass null to send the message immediately

-> Sem r (Error Ok) 

Edits the time when a scheduled message will be sent. Scheduling state of all messages in the same album or forwarded together with the message will be also changed

getTextEntities Source #

Arguments

:: Member TDLib r 
=> T

The text in which to look for entites

-> Sem r (Error TextEntities) 

Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously

parseTextEntities Source #

Arguments

:: Member TDLib r 
=> T

The text to parse

-> TextParseMode

Text parse mode

-> Sem r (Error FormattedText) 

Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. This is an offline method. Can be called before authorization. Can be called synchronously

parseMarkdown Source #

Arguments

:: Member TDLib r 
=> FormattedText

The text to parse. For example, "italic ~~strikethrough~~ **bold** $sel:code:Error ``pre`` [italic text_url](telegram.org) italic**bold italicbold**"

-> Sem r (Error FormattedText) 

Parses Markdown entities in a human-friendly format, ignoring mark up errors. This is an offline method. Can be called before authorization. Can be called synchronously

getMarkdownText Source #

Arguments

:: Member TDLib r 
=> FormattedText

The text

-> Sem r (Error FormattedText) 

Replaces text entities with Markdown formatting in a human-friendly format. Entities that can't be represented in Markdown unambiguously are kept as is. This is an offline method. Can be called before authorization. Can be called synchronously

getFileMimeType Source #

Arguments

:: Member TDLib r 
=> T

The name of the file or path to the file

-> Sem r (Error Text) 

Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously

getFileExtension Source #

Arguments

:: Member TDLib r 
=> T

The MIME type of the file

-> Sem r (Error Text) 

Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously

cleanFileName Source #

Arguments

:: Member TDLib r 
=> T

File name or path to the file

-> Sem r (Error Text) 

Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. This is an offline method. Can be called before authorization. Can be called synchronously

getLanguagePackString Source #

Arguments

:: Member TDLib r 
=> T

Path to the language pack database in which strings are stored

-> T

Localization target to which the language pack belongs

-> T

Language pack identifier

-> T

Language pack key of the string to be returned

-> Sem r (Error LanguagePackStringValue) 

Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. This is an offline method. Can be called before authorization. Can be called synchronously

getJsonValue Source #

Arguments

:: Member TDLib r 
=> T

The JSON-serialized string

-> Sem r (Error JsonValue) 

Converts a JSON-serialized string to corresponding JsonValue object. This is an offline method. Can be called before authorization. Can be called synchronously

getJsonString Source #

Arguments

:: Member TDLib r 
=> JsonValue

The JsonValue object

-> Sem r (Error Text) 

Converts a JsonValue object to corresponding JSON-serialized string. This is an offline method. Can be called before authorization. Can be called synchronously

setPollAnswer Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat to which the poll belongs

-> I53

Identifier of the message containing the poll

-> [I32]

0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers

-> Sem r (Error Ok) 

Changes the user answer to a poll. A poll in quiz mode can be answered only once

getPollVoters Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat to which the poll belongs

-> I53

Identifier of the message containing the poll

-> I32

0-based identifier of the answer option

-> I32

Number of users to skip in the result; must be non-negative

-> I32

The maximum number of users to be returned; must be positive and can't be greater than 50. Fewer users may be returned than specified by the limit, even if the end of the voter list has not been reached

-> Sem r (Error Users) 

Returns users voted for the specified option in a non-anonymous polls. For the optimal performance the number of returned users is chosen by the library

stopPoll Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat to which the poll belongs

-> I53

Identifier of the message containing the poll

-> ReplyMarkup

The new message reply markup; for bots only

-> Sem r (Error Ok) 

Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set

getLoginUrlInfo Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier of the message with the button

-> I53

Message identifier of the message with the button

-> I32

Button identifier

-> Sem r (Error LoginUrlInfo) 

Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button

getLoginUrl Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier of the message with the button

-> I53

Message identifier of the message with the button

-> I32

Button identifier

-> Bool

True, if the user allowed the bot to send them messages

-> Sem r (Error HttpUrl) 

Returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline button of type inlineKeyboardButtonTypeLoginUrl.

getInlineQueryResults Source #

Arguments

:: Member TDLib r 
=> I32

The identifier of the target bot

-> I53

Identifier of the chat where the query was sent

-> Location

Location of the user, only if needed

-> T

Text of the query

-> T

Offset of the first entry to return

-> Sem r (Error InlineQueryResults) 

Sends an inline query to a bot and returns its results. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires

answerInlineQuery Source #

Arguments

:: Member TDLib r 
=> I64

Identifier of the inline query

-> Bool

True, if the result of the query can be cached for the specified user

-> [InputInlineQueryResult]

The results of the query

-> I32

Allowed time to cache the results of the query, in seconds

-> T

Offset for the next inline query; pass an empty string if there are no more results

-> T

If non-empty, this text should be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter

-> T

The parameter for the bot start message

-> Sem r (Error Ok) 

Sets the result of an inline query; for bots only

getCallbackQueryAnswer Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat with the message

-> I53

Identifier of the message from which the query originated

-> CallbackQueryPayload

Query payload

-> Sem r (Error CallbackQueryAnswer) 

Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires

answerCallbackQuery Source #

Arguments

:: Member TDLib r 
=> I64

Identifier of the callback query

-> T

Text of the answer

-> Bool

If true, an alert should be shown to the user instead of a toast notification

-> T

URL to be opened

-> I32

Time during which the result of the query can be cached, in seconds

-> Sem r (Error Ok) 

Sets the result of a callback query; for bots only

answerShippingQuery Source #

Arguments

:: Member TDLib r 
=> I64

Identifier of the shipping query

-> [ShippingOption]

Available shipping options

-> T

An error message, empty on success

-> Sem r (Error Ok) 

Sets the result of a shipping query; for bots only

answerPreCheckoutQuery Source #

Arguments

:: Member TDLib r 
=> I64

Identifier of the pre-checkout query

-> T

An error message, empty on success

-> Sem r (Error Ok) 

Sets the result of a pre-checkout query; for bots only

setGameScore Source #

Arguments

:: Member TDLib r 
=> I53

The chat to which the message with the game belongs

-> I53

Identifier of the message

-> Bool

True, if the message should be edited

-> I32

User identifier

-> I32

The new score

-> Bool

Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table

-> Sem r (Error Message) 

Updates the game score of the specified user in the game; for bots only

setInlineGameScore Source #

Arguments

:: Member TDLib r 
=> T

Inline message identifier

-> Bool

True, if the message should be edited

-> I32

User identifier

-> I32

The new score

-> Bool

Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table

-> Sem r (Error Ok) 

Updates the game score of the specified user in a game; for bots only

getGameHighScores Source #

Arguments

:: Member TDLib r 
=> I53

The chat that contains the message with the game

-> I53

Identifier of the message

-> I32

User identifier

-> Sem r (Error GameHighScores) 

Returns the high scores for a game and some part of the high score table in the range of the specified user; for bots only

getInlineGameHighScores Source #

Arguments

:: Member TDLib r 
=> T

Inline message identifier

-> I32

User identifier

-> Sem r (Error GameHighScores) 

Returns game high scores and some part of the high score table in the range of the specified user; for bots only

deleteChatReplyMarkup Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> I53

The message identifier of the used keyboard

-> Sem r (Error Ok) 

Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup will be changed

sendChatAction Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> ChatAction

The action description

-> Sem r (Error Ok) 

Sends a notification about user activity in a chat

openChat Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Sem r (Error Ok) 

Informs TDLib that the chat is opened by the user. Many useful activities depend on the chat being opened or closed (e.g., in supergroups and channels all updates are received only for opened chats)

closeChat Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Sem r (Error Ok) 

Informs TDLib that the chat is closed by the user. Many useful activities depend on the chat being opened or closed

viewMessages Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> [I53]

The identifiers of the messages being viewed

-> Bool

True, if messages in closed chats should be marked as read

-> Sem r (Error Ok) 

Informs TDLib that messages are being viewed by the user. Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels)

openMessageContent Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier of the message

-> I53

Identifier of the message with the opened content

-> Sem r (Error Ok) 

Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message). An updateMessageContentOpened update will be generated if something has changed

readAllChatMentions Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Sem r (Error Ok) 

Marks all mentions in a chat as read

createPrivateChat Source #

Arguments

:: Member TDLib r 
=> I32

User identifier

-> Bool

If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect

-> Sem r (Error Chat) 

Returns an existing chat corresponding to a given user

createBasicGroupChat Source #

Arguments

:: Member TDLib r 
=> I32

Basic group identifier

-> Bool

If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect

-> Sem r (Error Chat) 

Returns an existing chat corresponding to a known basic group

createSupergroupChat Source #

Arguments

:: Member TDLib r 
=> I32

Supergroup or channel identifier

-> Bool

If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect

-> Sem r (Error Chat) 

Returns an existing chat corresponding to a known supergroup or channel

createSecretChat Source #

Arguments

:: Member TDLib r 
=> I32

Secret chat identifier

-> Sem r (Error Chat) 

Returns an existing chat corresponding to a known secret chat

createNewBasicGroupChat Source #

Arguments

:: Member TDLib r 
=> [I32]

Identifiers of users to be added to the basic group

-> T

Title of the new basic group; 1-128 characters

-> Sem r (Error Chat) 

Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat

createNewSupergroupChat Source #

Arguments

:: Member TDLib r 
=> T

Title of the new chat; 1-128 characters

-> Bool

True, if a channel chat should be created

-> T

Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat

-> ChatLocation

Chat location if a location-based supergroup is being created

-> Sem r (Error Chat) 

Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat

createNewSecretChat Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the target user

-> Sem r (Error Chat) 

Creates a new secret chat. Returns the newly created chat

upgradeBasicGroupChatToSupergroupChat Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat to upgrade

-> Sem r (Error Chat) 

Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires creator privileges. Deactivates the original basic group

setChatChatList Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> ChatList

New chat list of the chat. The chat with the current user (Saved Messages) and the chat 777000 (Telegram) can't be moved to the Archive chat list

-> Sem r (Error Ok) 

Moves a chat to a different chat list. Current chat list of the chat must ne non-null

setChatTitle Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> T

New title of the chat; 1-128 characters

-> Sem r (Error Ok) 

Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The title will not be changed until the request to the server has been completed

setChatPhoto Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> InputFile

New chat photo. You can use a zero InputFileId to delete the chat photo. Files that are accessible only by HTTP URL are not acceptable

-> Sem r (Error Ok) 

Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The photo will not be changed before request to the server has been completed

setChatPermissions Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> ChatPermissions

New non-administrator members permissions in the chat

-> Sem r (Error Ok) 

Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right

setChatDraftMessage Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> DraftMessage

New draft message; may be null

-> Sem r (Error Ok) 

Changes the draft message in a chat

setChatNotificationSettings Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> ChatNotificationSettings

New notification settings for the chat. If the chat is muted for more than 1 week, it is considered to be muted forever

-> Sem r (Error Ok) 

Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed

toggleChatIsPinned Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Bool

New value of is_pinned

-> Sem r (Error Ok) 

Changes the pinned state of a chat. You can pin up to GetOption("pinned_chat_count_max")GetOption("pinned_archived_chat_count_max") non-secret chats and the same number of secret chats in the mainarchive chat list

toggleChatIsMarkedAsUnread Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Bool

New value of is_marked_as_unread

-> Sem r (Error Ok) 

Changes the marked as unread state of a chat

toggleChatDefaultDisableNotification Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Bool

New value of default_disable_notification

-> Sem r (Error Ok) 

Changes the value of the default disable_notification parameter, used when a message is sent to a chat

setChatClientData Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> T

New value of client_data

-> Sem r (Error Ok) 

Changes client data associated with a chat

setChatDescription Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat

-> T

Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info rights

-> Sem r (Error Ok) 

Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info rights

setChatDiscussionGroup Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages rights in the supergroup)

-> I53

Identifier of a new channel's discussion group. Use 0 to remove the discussion group.

-> Sem r (Error Ok) 

Changes the discussion group of a channel chat; requires can_change_info rights in the channel if it is specified

setChatLocation Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> ChatLocation

New location for the chat; must be valid and not null

-> Sem r (Error Ok) 

Changes the location of a chat. Available only for some location-based supergroups, use supergroupFullInfo.can_set_location to check whether the method is allowed to use

setChatSlowModeDelay Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> I32

New slow mode delay for the chat; must be one of 0, 10, 30, 60, 300, 900, 3600

-> Sem r (Error Ok) 

Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights

pinChatMessage Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat

-> I53

Identifier of the new pinned message

-> Bool

True, if there should be no notification about the pinned message

-> Sem r (Error Ok) 

Pins a message in a chat; requires can_pin_messages rights

unpinChatMessage Source #

Arguments

:: Member TDLib r 
=> I53

Identifier of the chat

-> Sem r (Error Ok) 

Removes the pinned message from a chat; requires can_pin_messages rights in the group or channel

joinChat Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Sem r (Error Ok) 

Adds current user as a new member to a chat. Private and secret chats can't be joined using this method

leaveChat Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Sem r (Error Ok) 

Removes current user from chat members. Private and secret chats can't be left using this method

addChatMember Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> I32

Identifier of the user

-> I32

The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels

-> Sem r (Error Ok) 

Adds a new member to a chat. Members can't be added to private or secret chats. Members will not be added until the chat state has been synchronized with the server

addChatMembers Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> [I32]

Identifiers of the users to be added to the chat

-> Sem r (Error Ok) 

Adds multiple new members to a chat. Currently this option is only available for supergroups and channels. This option can't be used to join a chat. Members can't be added to a channel if it has more than 200 members. Members will not be added until the chat state has been synchronized with the server

setChatMemberStatus Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> I32

User identifier

-> ChatMemberStatus

The new status of the member in the chat

-> Sem r (Error Ok) 

Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for adding new members to the chat and transferring chat ownership; instead, use addChatMember or transferChatOwnership. The chat member status will not be changed until it has been synchronized with the server

canTransferOwnership :: Member TDLib r => Sem r (Error CanTransferOwnershipResult) Source #

Checks whether the current session can be used to transfer a chat ownership to another user

transferChatOwnership Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> I32

Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user

-> T

The password of the current user

-> Sem r (Error Ok) 

Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats

getChatMember Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> I32

User identifier

-> Sem r (Error ChatMember) 

Returns information about a single member of a chat

searchChatMembers Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> T

Query to search for

-> I32

The maximum number of users to be returned

-> ChatMembersFilter

The type of users to return. By default, chatMembersFilterMembers

-> Sem r (Error ChatMembers) 

Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels

getChatAdministrators Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Sem r (Error ChatAdministrators) 

Returns a list of administrators of the chat with their custom titles

clearAllDraftMessages Source #

Arguments

:: Member TDLib r 
=> Bool

If true, local draft messages in secret chats will not be cleared

-> Sem r (Error Ok) 

Clears draft messages in all chats

getChatNotificationSettingsExceptions Source #

Arguments

:: Member TDLib r 
=> NotificationSettingsScope

If specified, only chats from the specified scope will be returned

-> Bool

If true, also chats with non-default sound will be returned

-> Sem r (Error Chats) 

Returns list of chats with non-default notification settings

getScopeNotificationSettings Source #

Arguments

:: Member TDLib r 
=> NotificationSettingsScope

Types of chats for which to return the notification settings information

-> Sem r (Error ScopeNotificationSettings) 

Returns the notification settings for chats of a given type

setScopeNotificationSettings Source #

Arguments

:: Member TDLib r 
=> NotificationSettingsScope

Types of chats for which to change the notification settings

-> ScopeNotificationSettings

The new notification settings for the given scope

-> Sem r (Error Ok) 

Changes notification settings for chats of a given type

resetAllNotificationSettings :: Member TDLib r => Sem r (Error Ok) Source #

Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to "default" and message previews are shown

setPinnedChats Source #

Arguments

:: Member TDLib r 
=> ChatList

Chat list in which to change the order of pinned chats

-> [I53]

The new list of pinned chats

-> Sem r (Error Ok) 

Changes the order of pinned chats

downloadFile Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the file to download

-> I32

Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded first

-> I32

The starting position from which the file should be downloaded

-> I32

Number of bytes which should be downloaded starting from the "offset" position before the download will be automatically cancelled; use 0 to download without a limit

-> Bool

If false, this request returns file state just after the download has been started. If true, this request returns file state only after

-> Sem r (Error File) 

Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates

getFileDownloadedPrefixSize Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the file

-> I32

Offset from which downloaded prefix size should be calculated

-> Sem r (Error Count) 

Returns file downloaded prefix size from a given offset

cancelDownloadFile Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of a file to stop downloading

-> Bool

Pass true to stop downloading only if it hasn't been started, i.e. request hasn't been sent to server

-> Sem r (Error Ok) 

Stops the downloading of a file. If a file has already been downloaded, does nothing

uploadFile Source #

Arguments

:: Member TDLib r 
=> InputFile

File to upload

-> FileType

File type

-> I32

Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which uploadFile was called will be uploaded first

-> Sem r (Error File) 

Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message

cancelUploadFile Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the file to stop uploading

-> Sem r (Error Ok) 

Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined

writeGeneratedFilePart Source #

Arguments

:: Member TDLib r 
=> I64

The identifier of the generation process

-> I32

The offset from which to write the data to the file

-> ByteString64

The data to write

-> Sem r (Error Ok) 

Writes a part of a generated file. This method is intended to be used only if the client has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file

setFileGenerationProgress Source #

Arguments

:: Member TDLib r 
=> I64

The identifier of the generation process

-> I32

Expected size of the generated file, in bytes; 0 if unknown

-> I32

The number of bytes already generated

-> Sem r (Error Ok) 

Informs TDLib on a file generation progress

finishFileGeneration Source #

Arguments

:: Member TDLib r 
=> I64

The identifier of the generation process

-> Error

If set, means that file generation has failed and should be terminated

-> Sem r (Error Ok) 

Finishes the file generation

readFilePart Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the file. The file must be located in the TDLib file cache

-> I32

The offset from which to read the file

-> I32

Number of bytes to read. An error will be returned if there are not enough bytes available in the file from the specified position. Pass 0 to read all available data from the specified position

-> Sem r (Error FilePart) 

Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the client has no direct access to TDLib's file system, because it is usually slower than a direct read from the file

deleteFile Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the file to delete

-> Sem r (Error Ok) 

Deletes a file from the TDLib file cache

generateChatInviteLink Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Sem r (Error ChatInviteLink) 

Generates a new invite link for a chat; the previously generated link is revoked. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right

checkChatInviteLink Source #

Arguments

:: Member TDLib r 
=> T

Invite link to be checked; should begin with "https://t.me/joinchat/", "https://telegram.me/joinchat/", or "https://telegram.dog/joinchat/"

-> Sem r (Error ChatInviteLinkInfo) 

Checks the validity of an invite link for a chat and returns information about the corresponding chat

joinChatByInviteLink Source #

Arguments

:: Member TDLib r 
=> T

Invite link to import; should begin with "https://t.me/joinchat/", "https://telegram.me/joinchat/", or "https://telegram.dog/joinchat/"

-> Sem r (Error Chat) 

Uses an invite link to add the current user to the chat if possible. The new member will not be added until the chat state has been synchronized with the server

createCall Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the user to be called

-> CallProtocol

Description of the call protocols supported by the client

-> Sem r (Error CallId) 

Creates a new call

acceptCall Source #

Arguments

:: Member TDLib r 
=> I32

Call identifier

-> CallProtocol

Description of the call protocols supported by the client

-> Sem r (Error Ok) 

Accepts an incoming call

discardCall Source #

Arguments

:: Member TDLib r 
=> I32

Call identifier

-> Bool

True, if the user was disconnected

-> I32

The call duration, in seconds

-> I64

Identifier of the connection used during the call

-> Sem r (Error Ok) 

Discards a call

sendCallRating Source #

Arguments

:: Member TDLib r 
=> I32

Call identifier

-> I32

Call rating; 1-5

-> T

An optional user comment if the rating is less than 5

-> [CallProblem]

List of the exact types of problems with the call, specified by the user

-> Sem r (Error Ok) 

Sends a call rating

sendCallDebugInformation Source #

Arguments

:: Member TDLib r 
=> I32

Call identifier

-> T

Debug information in application-specific format

-> Sem r (Error Ok) 

Sends debug information for a call

blockUser Source #

Arguments

:: Member TDLib r 
=> I32

User identifier

-> Sem r (Error Ok) 

Adds a user to the blacklist

unblockUser Source #

Arguments

:: Member TDLib r 
=> I32

User identifier

-> Sem r (Error Ok) 

Removes a user from the blacklist

getBlockedUsers Source #

Arguments

:: Member TDLib r 
=> I32

Number of users to skip in the result; must be non-negative

-> I32

The maximum number of users to return; up to 100

-> Sem r (Error Users) 

Returns users that were blocked by the current user

addContact Source #

Arguments

:: Member TDLib r 
=> Contact

The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored

-> Bool

True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field UserFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number

-> Sem r (Error Ok) 

Adds a user to the contact list or edits an existing contact by their user identifier

importContacts Source #

Arguments

:: Member TDLib r 
=> [Contact]

The list of contacts to import or edit; contacts' vCard are ignored and are not imported

-> Sem r (Error ImportedContacts) 

Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored

getContacts :: Member TDLib r => Sem r (Error Users) Source #

Returns all user contacts

searchContacts Source #

Arguments

:: Member TDLib r 
=> T

Query to search for; may be empty to return all contacts

-> I32

The maximum number of users to be returned

-> Sem r (Error Users) 

Searches for the specified query in the first names, last names and usernames of the known user contacts

removeContacts Source #

Arguments

:: Member TDLib r 
=> [I32]

Identifiers of users to be deleted

-> Sem r (Error Ok) 

Removes users from the contact list

getImportedContactCount :: Member TDLib r => Sem r (Error Count) Source #

Returns the total number of imported contacts

changeImportedContacts :: Member TDLib r => [Contact] -> Sem r (Error ImportedContacts) Source #

Changes imported contacts using the list of current user contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts.

clearImportedContacts :: Member TDLib r => Sem r (Error Ok) Source #

Clears all imported contacts, contact list remains unchanged

sharePhoneNumber Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the user with whom to share the phone number. The user must be a mutual contact

-> Sem r (Error Ok) 

Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber

getUserProfilePhotos Source #

Arguments

:: Member TDLib r 
=> I32

User identifier

-> I32

The number of photos to skip; must be non-negative

-> I32

The maximum number of photos to be returned; up to 100

-> Sem r (Error UserProfilePhotos) 

Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already

getStickers Source #

Arguments

:: Member TDLib r 
=> T

String representation of emoji. If empty, returns all known installed stickers

-> I32

The maximum number of stickers to be returned

-> Sem r (Error Stickers) 

Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is not empty, favorite and recently used stickers may also be returned

searchStickers Source #

Arguments

:: Member TDLib r 
=> T

String representation of emoji; must be non-empty

-> I32

The maximum number of stickers to be returned

-> Sem r (Error Stickers) 

Searches for stickers from public sticker sets that correspond to a given emoji

getInstalledStickerSets Source #

Arguments

:: Member TDLib r 
=> Bool

Pass true to return mask sticker sets; pass false to return ordinary sticker sets

-> Sem r (Error StickerSets) 

Returns a list of installed sticker sets

getArchivedStickerSets Source #

Arguments

:: Member TDLib r 
=> Bool

Pass true to return mask stickers sets; pass false to return ordinary sticker sets

-> I64

Identifier of the sticker set from which to return the result

-> I32

The maximum number of sticker sets to return

-> Sem r (Error StickerSets) 

Returns a list of archived sticker sets

getTrendingStickerSets Source #

Arguments

:: Member TDLib r 
=> I32

The offset from which to return the sticker sets; must be non-negative

-> I32

The maximum number of sticker sets to be returned; must be non-negative. Fewer sticker sets may be returned than specified by the limit, even if the end of the list has not been reached

-> Sem r (Error StickerSets) 

Returns a list of trending sticker sets. For the optimal performance the number of returned sticker sets is chosen by the library

getAttachedStickerSets Source #

Arguments

:: Member TDLib r 
=> I32

File identifier

-> Sem r (Error StickerSets) 

Returns a list of sticker sets attached to a file. Currently only photos and videos can have attached sticker sets

getStickerSet Source #

Arguments

:: Member TDLib r 
=> I64

Identifier of the sticker set

-> Sem r (Error StickerSet) 

Returns information about a sticker set by its identifier

searchStickerSet Source #

Arguments

:: Member TDLib r 
=> T

Name of the sticker set

-> Sem r (Error StickerSet) 

Searches for a sticker set by its name

searchInstalledStickerSets Source #

Arguments

:: Member TDLib r 
=> Bool

Pass true to return mask sticker sets; pass false to return ordinary sticker sets

-> T

Query to search for

-> I32

The maximum number of sticker sets to return

-> Sem r (Error StickerSets) 

Searches for installed sticker sets by looking for specified query in their title and name

searchStickerSets Source #

Arguments

:: Member TDLib r 
=> T

Query to search for

-> Sem r (Error StickerSets) 

Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results

changeStickerSet Source #

Arguments

:: Member TDLib r 
=> I64

Identifier of the sticker set

-> Bool

The new value of is_installed

-> Bool

The new value of is_archived. A sticker set can't be installed and archived simultaneously

-> Sem r (Error Ok) 

Installsuninstalls or activatesarchives a sticker set

viewTrendingStickerSets Source #

Arguments

:: Member TDLib r 
=> [I64]

Identifiers of viewed trending sticker sets

-> Sem r (Error Ok) 

Informs the server that some trending sticker sets have been viewed by the user

reorderInstalledStickerSets Source #

Arguments

:: Member TDLib r 
=> Bool

Pass true to change the order of mask sticker sets; pass false to change the order of ordinary sticker sets

-> [I64]

Identifiers of installed sticker sets in the new correct order

-> Sem r (Error Ok) 

Changes the order of installed sticker sets

getRecentStickers Source #

Arguments

:: Member TDLib r 
=> Bool

Pass true to return stickers and masks that were recently attached to photos or video files; pass false to return recently sent stickers

-> Sem r (Error Stickers) 

Returns a list of recently used stickers

addRecentSticker Source #

Arguments

:: Member TDLib r 
=> Bool

Pass true to add the sticker to the list of stickers recently attached to photo or video files; pass false to add the sticker to the list of recently sent stickers

-> InputFile

Sticker file to add

-> Sem r (Error Stickers) 

Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list

removeRecentSticker Source #

Arguments

:: Member TDLib r 
=> Bool

Pass true to remove the sticker from the list of stickers recently attached to photo or video files; pass false to remove the sticker from the list of recently sent stickers

-> InputFile

Sticker file to delete

-> Sem r (Error Ok) 

Removes a sticker from the list of recently used stickers

clearRecentStickers Source #

Arguments

:: Member TDLib r 
=> Bool

Pass true to clear the list of stickers recently attached to photo or video files; pass false to clear the list of recently sent stickers

-> Sem r (Error Ok) 

Clears the list of recently used stickers

getFavoriteStickers :: Member TDLib r => Sem r (Error Stickers) Source #

Returns favorite stickers

addFavoriteSticker Source #

Arguments

:: Member TDLib r 
=> InputFile

Sticker file to add

-> Sem r (Error Ok) 

Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list

removeFavoriteSticker Source #

Arguments

:: Member TDLib r 
=> InputFile

Sticker file to delete from the list

-> Sem r (Error Ok) 

Removes a sticker from the list of favorite stickers

getStickerEmojis Source #

Arguments

:: Member TDLib r 
=> InputFile

Sticker file identifier

-> Sem r (Error Emojis) 

Returns emoji corresponding to a sticker. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object

searchEmojis Source #

Arguments

:: Member TDLib r 
=> T

Text to search for

-> Bool

True, if only emojis, which exactly match text needs to be returned

-> [T]

List of possible IETF language tags of the user's input language; may be empty if unknown

-> Sem r (Error Emojis) 

Searches for emojis by keywords. Supported only if the file database is enabled

getEmojiSuggestionsUrl Source #

Arguments

:: Member TDLib r 
=> T

Language code for which the emoji replacements will be suggested

-> Sem r (Error HttpUrl) 

Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation

getSavedAnimations :: Member TDLib r => Sem r (Error Animations) Source #

Returns saved animations

addSavedAnimation Source #

Arguments

:: Member TDLib r 
=> InputFile

The animation file to be added. Only animations known to the server (i.e. successfully sent via a message) can be added to the list

-> Sem r (Error Ok) 

Manually adds a new animation to the list of saved animations. The new animation is added to the beginning of the list. If the animation was already in the list, it is removed first. Only non-secret video animations with MIME type "video/mp4" can be added to the list

removeSavedAnimation Source #

Arguments

:: Member TDLib r 
=> InputFile

Animation file to be removed

-> Sem r (Error Ok) 

Removes an animation from the list of saved animations

getRecentInlineBots :: Member TDLib r => Sem r (Error Users) Source #

Returns up to 20 recently used inline bots in the order of their last usage

searchHashtags Source #

Arguments

:: Member TDLib r 
=> T

Hashtag prefix to search for

-> I32

The maximum number of hashtags to be returned

-> Sem r (Error Hashtags) 

Searches for recently used hashtags by their prefix

removeRecentHashtag Source #

Arguments

:: Member TDLib r 
=> T

Hashtag to delete

-> Sem r (Error Ok) 

Removes a hashtag from the list of recently used hashtags

getWebPagePreview Source #

Arguments

:: Member TDLib r 
=> FormattedText

Message text with formatting

-> Sem r (Error WebPage) 

Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview

getWebPageInstantView Source #

Arguments

:: Member TDLib r 
=> T

The web page URL

-> Bool

If true, the full instant view for the web page will be returned

-> Sem r (Error WebPageInstantView) 

Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page

setProfilePhoto Source #

Arguments

:: Member TDLib r 
=> InputFile

Profile photo to set. inputFileId and inputFileRemote may still be unsupported

-> Sem r (Error Ok) 

Uploads a new profile photo for the current user. If something changes, updateUser will be sent

deleteProfilePhoto Source #

Arguments

:: Member TDLib r 
=> I64

Identifier of the profile photo to delete

-> Sem r (Error Ok) 

Deletes a profile photo. If something changes, updateUser will be sent

setName Source #

Arguments

:: Member TDLib r 
=> T

The new value of the first name for the user; 1-64 characters

-> T

The new value of the optional last name for the user; 0-64 characters

-> Sem r (Error Ok) 

Changes the first and last name of the current user. If something changes, updateUser will be sent

setBio Source #

Arguments

:: Member TDLib r 
=> T

The new value of the user bio; 0-70 characters without line feeds

-> Sem r (Error Ok) 

Changes the bio of the current user

setUsername Source #

Arguments

:: Member TDLib r 
=> T

The new value of the username. Use an empty string to remove the username

-> Sem r (Error Ok) 

Changes the username of the current user. If something changes, updateUser will be sent

setLocation Source #

Arguments

:: Member TDLib r 
=> Location

The new location of the user

-> Sem r (Error Ok) 

Changes the location of the current user. Needs to be called if GetOption("is_location_visible") is true and location changes for more than 1 kilometer

changePhoneNumber Source #

Arguments

:: Member TDLib r 
=> T

The new phone number of the user in international format

-> PhoneNumberAuthenticationSettings

Settings for the authentication of the user's phone number

-> Sem r (Error AuthenticationCodeInfo) 

Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code

resendChangePhoneNumberCode :: Member TDLib r => Sem r (Error AuthenticationCodeInfo) Source #

Re-sends the authentication code sent to confirm a new phone number for the user. Works only if the previously received authenticationCodeInfo next_code_type was not null

checkChangePhoneNumberCode Source #

Arguments

:: Member TDLib r 
=> T

Verification code received by SMS, phone call or flash call

-> Sem r (Error Ok) 

Checks the authentication code sent to confirm a new phone number of the user

setCommands Source #

Arguments

:: Member TDLib r 
=> [BotCommand]

List of the bot's commands

-> Sem r (Error Ok) 

Sets the list of commands supported by the bot; for bots only

getActiveSessions :: Member TDLib r => Sem r (Error Sessions) Source #

Returns all active sessions of the current user

terminateSession Source #

Arguments

:: Member TDLib r 
=> I64

Session identifier

-> Sem r (Error Ok) 

Terminates a session of the current user

terminateAllOtherSessions :: Member TDLib r => Sem r (Error Ok) Source #

Terminates all other sessions of the current user

getConnectedWebsites :: Member TDLib r => Sem r (Error ConnectedWebsites) Source #

Returns all website where the current user used Telegram to log in

disconnectWebsite Source #

Arguments

:: Member TDLib r 
=> I64

Website identifier

-> Sem r (Error Ok) 

Disconnects website from the current user's Telegram account

disconnectAllWebsites :: Member TDLib r => Sem r (Error Ok) Source #

Disconnects all websites from the current user's Telegram account

setSupergroupUsername Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the supergroup or channel

-> T

New value of the username. Use an empty string to remove the username

-> Sem r (Error Ok) 

Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel

setSupergroupStickerSet Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the supergroup

-> I64

New value of the supergroup sticker set identifier. Use 0 to remove the supergroup sticker set

-> Sem r (Error Ok) 

Changes the sticker set of a supergroup; requires can_change_info rights

toggleSupergroupSignMessages Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the channel

-> Bool

New value of sign_messages

-> Sem r (Error Ok) 

Toggles sender signatures messages sent in a channel; requires can_change_info rights

toggleSupergroupIsAllHistoryAvailable Source #

Arguments

:: Member TDLib r 
=> I32

The identifier of the supergroup

-> Bool

The new value of is_all_history_available

-> Sem r (Error Ok) 

Toggles whether the message history of a supergroup is available to new members; requires can_change_info rights

reportSupergroupSpam Source #

Arguments

:: Member TDLib r 
=> I32

Supergroup identifier

-> I32

User identifier

-> [I53]

Identifiers of messages sent in the supergroup by the user. This list must be non-empty

-> Sem r (Error Ok) 

Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup

getSupergroupMembers Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the supergroup or channel

-> SupergroupMembersFilter

The type of users to return. By default, supergroupMembersRecent

-> I32

Number of users to skip

-> I32

The maximum number of users be returned; up to 200

-> Sem r (Error ChatMembers) 

Returns information about members or banned users in a supergroup or channel. Can be used only if SupergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters

deleteSupergroup Source #

Arguments

:: Member TDLib r 
=> I32

Identifier of the supergroup or channel

-> Sem r (Error Ok) 

Deletes a supergroup or channel along with all messages in the corresponding chat. This will release the supergroup or channel username and remove all members; requires owner privileges in the supergroup or channel. Chats with more than 1000 members can't be deleted using this method

closeSecretChat Source #

Arguments

:: Member TDLib r 
=> I32

Secret chat identifier

-> Sem r (Error Ok) 

Closes a secret chat, effectively transferring its state to secretChatStateClosed

getChatEventLog Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> T

Search query by which to filter events

-> I64

Identifier of an event from which to return results. Use 0 to get results from the latest events

-> I32

The maximum number of events to return; up to 100

-> ChatEventLogFilters

The types of events to return. By default, all types will be returned

-> [I32]

User identifiers by which to filter events. By default, events relating to all users will be returned

-> Sem r (Error ChatEvents) 

Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id)

getPaymentForm Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier of the Invoice message

-> I53

Message identifier

-> Sem r (Error PaymentForm) 

Returns an invoice payment form. This method should be called when the user presses inlineKeyboardButtonBuy

validateOrderInfo Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier of the Invoice message

-> I53

Message identifier

-> OrderInfo

The order information, provided by the user

-> Bool

True, if the order information can be saved

-> Sem r (Error ValidatedOrderInfo) 

Validates the order information provided by a user and returns the available shipping options for a flexible invoice

sendPaymentForm Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier of the Invoice message

-> I53

Message identifier

-> T

Identifier returned by ValidateOrderInfo, or an empty string

-> T

Identifier of a chosen shipping option, if applicable

-> InputCredentials

The credentials chosen by user for payment

-> Sem r (Error PaymentResult) 

Sends a filled-out payment form to the bot for final verification

getPaymentReceipt Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier of the PaymentSuccessful message

-> I53

Message identifier

-> Sem r (Error PaymentReceipt) 

Returns information about a successful payment

getSavedOrderInfo :: Member TDLib r => Sem r (Error OrderInfo) Source #

Returns saved order info, if any

deleteSavedOrderInfo :: Member TDLib r => Sem r (Error Ok) Source #

Deletes saved order info

deleteSavedCredentials :: Member TDLib r => Sem r (Error Ok) Source #

Deletes saved credentials for all payment provider bots

getSupportUser :: Member TDLib r => Sem r (Error User) Source #

Returns a user that can be contacted to get support

getBackgrounds Source #

Arguments

:: Member TDLib r 
=> Bool

True, if the backgrounds needs to be ordered for dark theme

-> Sem r (Error Backgrounds) 

Returns backgrounds installed by the user

getBackgroundUrl Source #

Arguments

:: Member TDLib r 
=> T

Background name

-> BackgroundType

Background type

-> Sem r (Error HttpUrl) 

Constructs a persistent HTTP URL for a background

searchBackground Source #

Arguments

:: Member TDLib r 
=> T

The name of the background

-> Sem r (Error Background) 

Searches for a background by its name

setBackground Source #

Arguments

:: Member TDLib r 
=> InputBackground

The input background to use, null for filled backgrounds

-> BackgroundType

Background type; null for default background. The method will return error 404 if type is null

-> Bool

True, if the background is chosen for dark theme

-> Sem r (Error Background) 

Changes the background selected by the user; adds background to the list of installed backgrounds

removeBackground Source #

Arguments

:: Member TDLib r 
=> I64

The background identifier

-> Sem r (Error Ok) 

Removes background from the list of installed backgrounds

resetBackgrounds :: Member TDLib r => Sem r (Error Ok) Source #

Resets list of installed backgrounds to its default value

getLocalizationTargetInfo Source #

Arguments

:: Member TDLib r 
=> Bool

If true, returns only locally available information without sending network requests

-> Sem r (Error LocalizationTargetInfo) 

Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization

getLanguagePackInfo Source #

Arguments

:: Member TDLib r 
=> T

Language pack identifier

-> Sem r (Error LanguagePackInfo) 

Returns information about a language pack. Returned language pack identifier may be different from a provided one. Can be called before authorization

getLanguagePackStrings Source #

Arguments

:: Member TDLib r 
=> T

Language pack identifier of the strings to be returned

-> [T]

Language pack keys of the strings to be returned; leave empty to request all available strings

-> Sem r (Error LanguagePackStrings) 

Returns strings from a language pack in the current localization target by their keys. Can be called before authorization

synchronizeLanguagePack Source #

Arguments

:: Member TDLib r 
=> T

Language pack identifier

-> Sem r (Error Ok) 

Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization

addCustomServerLanguagePack Source #

Arguments

:: Member TDLib r 
=> T

Identifier of a language pack to be added; may be different from a name that is used in an "https://t.me/setlanguage/" link

-> Sem r (Error Ok) 

Adds a custom server language pack to the list of installed language packs in current localization target. Can be called before authorization

setCustomLanguagePack Source #

Arguments

:: Member TDLib r 
=> LanguagePackInfo

Information about the language pack. Language pack ID must start with X, consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization

-> [LanguagePackString]

Strings of the new language pack

-> Sem r (Error Ok) 

Adds or changes a custom local language pack to the current localization target

editCustomLanguagePackInfo Source #

Arguments

:: Member TDLib r 
=> LanguagePackInfo

New information about the custom local language pack

-> Sem r (Error Ok) 

Edits information about a custom local language pack in the current localization target. Can be called before authorization

setCustomLanguagePackString Source #

Arguments

:: Member TDLib r 
=> T

Identifier of a previously added custom local language pack in the current localization target

-> LanguagePackString

New language pack string

-> Sem r (Error Ok) 

Adds, edits or deletes a string in a custom local language pack. Can be called before authorization

deleteLanguagePack Source #

Arguments

:: Member TDLib r 
=> T

Identifier of the language pack to delete

-> Sem r (Error Ok) 

Deletes all information about a language pack in the current localization target. The language pack which is currently in use (including base language pack) or is being synchronized can't be deleted. Can be called before authorization

registerDevice Source #

Arguments

:: Member TDLib r 
=> DeviceToken

Device token

-> [I32]

List of user identifiers of other users currently using the client

-> Sem r (Error PushReceiverId) 

Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription

processPushNotification Source #

Arguments

:: Member TDLib r 
=> T

JSON-encoded push notification payload with all fields sent by the server, and "google.sent_time" and "google.notification.sound" fields added

-> Sem r (Error Ok) 

Handles a push notification. Returns error with code 406 if the push notification is not supported and connection to the server is required to fetch new data. Can be called before authorization

getPushReceiverId Source #

Arguments

:: Member TDLib r 
=> T

JSON-encoded push notification payload

-> Sem r (Error PushReceiverId) 

Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. This is an offline method. Can be called before authorization. Can be called synchronously

getRecentlyVisitedTMeUrls Source #

Arguments

:: Member TDLib r 
=> T

Google Play referrer to identify the user

-> Sem r (Error TMeUrls) 

Returns t.me URLs recently visited by a newly registered user

setUserPrivacySettingRules Source #

Arguments

:: Member TDLib r 
=> UserPrivacySetting

The privacy setting

-> UserPrivacySettingRules

The new privacy rules

-> Sem r (Error Ok) 

Changes user privacy settings

getUserPrivacySettingRules Source #

Arguments

:: Member TDLib r 
=> UserPrivacySetting

The privacy setting

-> Sem r (Error UserPrivacySettingRules) 

Returns the current privacy settings

getOption Source #

Arguments

:: Member TDLib r 
=> T

The name of the option

-> Sem r (Error OptionValue) 

Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization

setOption Source #

Arguments

:: Member TDLib r 
=> T

The name of the option

-> OptionValue

The new value of the option

-> Sem r (Error Ok) 

Sets the value of an option. (Check the list of available options on https://core.telegram.org/tdlib/options.) Only writable options can be set. Can be called before authorization

setAccountTtl Source #

Arguments

:: Member TDLib r 
=> AccountTtl

New account TTL

-> Sem r (Error Ok) 

Changes the period of inactivity after which the account of the current user will automatically be deleted

getAccountTtl :: Member TDLib r => Sem r (Error AccountTtl) Source #

Returns the period of inactivity after which the account of the current user will automatically be deleted

deleteAccount Source #

Arguments

:: Member TDLib r 
=> T

The reason why the account was deleted; optional

-> Sem r (Error Ok) 

Deletes the account of the current user, deleting all information associated with the user from the server. The phone number of the account can be used to create a new account. Can be called before authorization when the current authorization state is authorizationStateWaitPassword

removeChatActionBar Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Sem r (Error Ok) 

Removes a chat action bar without any other action

reportChat Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> ChatReportReason

The reason for reporting the chat

-> [I53]

Identifiers of reported messages, if any

-> Sem r (Error Ok) 

Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if this is a private chats with a bot, a private chat with a user sharing their location, a supergroup, or a channel, since other chats can't be checked by moderators

getChatStatisticsUrl Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> T

Parameters from "tg://statsrefresh?params=******" link

-> Bool

Pass true if a URL with the dark theme must be returned

-> Sem r (Error HttpUrl) 

Returns an HTTP URL with the chat statistics. Currently this method of getting the statistics is disabled and can be deleted in the future

getChatStatistics Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> Bool

Pass true if a dark theme is used by the app

-> Sem r (Error ChatStatistics) 

Returns detailed statistics about a chat. Currently this method can be used only for channels. Requires administrator rights in the channel

getChatStatisticsGraph Source #

Arguments

:: Member TDLib r 
=> I53

Chat identifier

-> T

The token for graph loading

-> I53

X-value for zoomed in graph or 0 otherwise

-> Sem r (Error StatisticsGraph) 

Loads asynchronous or zoomed in chat statistics graph

getStorageStatistics Source #

Arguments

:: Member TDLib r 
=> I32

The maximum number of chats with the largest storage usage for which separate statistics should be returned. All other chats will be grouped in entries with chat_id == 0. If the chat info database is not used, the chat_limit is ignored and is always set to 0

-> Sem r (Error StorageStatistics) 

Returns storage usage statistics. Can be called before authorization

getStorageStatisticsFast :: Member TDLib r => Sem r (Error StorageStatisticsFast) Source #

Quickly returns approximate storage usage statistics. Can be called before authorization

getDatabaseStatistics :: Member TDLib r => Sem r (Error DatabaseStatistics) Source #

Returns database statistics

optimizeStorage Source #

Arguments

:: Member TDLib r 
=> I53

Limit on the total size of files after deletion. Pass -1 to use the default limit

-> I32

Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit

-> I32

Limit on the total count of files after deletion. Pass -1 to use the default limit

-> I32

The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value

-> [FileType]

If not empty, only files with the given type(s) are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted

-> [I53]

If not empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos)

-> [I53]

If not empty, files from the given chats are excluded. Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos)

-> Bool

Pass true if deleted file statistics needs to be returned instead of the whole storage usage statistics. Affects only returned statistics

-> I32

Same as in getStorageStatistics. Affects only returned statistics

-> Sem r (Error StorageStatistics) 

Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted

setNetworkType :: Member TDLib r => NetworkType -> Sem r (Error Ok) Source #

Sets the current network type. Can be called before authorization. Calling this method forces all network connections to reopen, mitigating the delay in switching between different networks, so it should be called whenever the network is changed, even if the network type remains the same.

getNetworkStatistics Source #

Arguments

:: Member TDLib r 
=> Bool

If true, returns only data for the current library launch

-> Sem r (Error NetworkStatistics) 

Returns network data usage statistics. Can be called before authorization

addNetworkStatistics Source #

Arguments

:: Member TDLib r 
=> NetworkStatisticsEntry

The network statistics entry with the data to be added to statistics

-> Sem r (Error Ok) 

Adds the specified data to data usage statistics. Can be called before authorization

resetNetworkStatistics :: Member TDLib r => Sem r (Error Ok) Source #

Resets all network data usage statistics to zero. Can be called before authorization

getAutoDownloadSettingsPresets :: Member TDLib r => Sem r (Error AutoDownloadSettingsPresets) Source #

Returns auto-download settings presets for the current user

setAutoDownloadSettings Source #

Arguments

:: Member TDLib r 
=> AutoDownloadSettings

New user auto-download settings

-> NetworkType

Type of the network for which the new settings are applied

-> Sem r (Error Ok) 

Sets auto-download settings

getBankCardInfo Source #

Arguments

:: Member TDLib r 
=> T

The bank card number

-> Sem r (Error BankCardInfo) 

Returns information about a bank card

getPassportElement Source #

Arguments

:: Member TDLib r 
=> PassportElementType

Telegram Passport element type

-> T

Password of the current user

-> Sem r (Error PassportElement) 

Returns one of the available Telegram Passport elements

getAllPassportElements Source #

Arguments

:: Member TDLib r 
=> T

Password of the current user

-> Sem r (Error PassportElements) 

Returns all available Telegram Passport elements

setPassportElement Source #

Arguments

:: Member TDLib r 
=> InputPassportElement

Input Telegram Passport element

-> T

Password of the current user

-> Sem r (Error PassportElement) 

Adds an element to the user's Telegram Passport. May return an error with a message PHONE_VERIFICATION_NEEDED or EMAIL_VERIFICATION_NEEDED if the chosen phone number or the chosen email address must be verified first

deletePassportElement Source #

Arguments

:: Member TDLib r 
=> PassportElementType

Element type

-> Sem r (Error Ok) 

Deletes a Telegram Passport element

setPassportElementErrors Source #

Arguments

:: Member TDLib r 
=> I32

User identifier

-> [InputPassportElementError]

The errors

-> Sem r (Error Ok) 

Informs the user that some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed

getPreferredCountryLanguage Source #

Arguments

:: Member TDLib r 
=> T

A two-letter ISO 3166-1 alpha-2 country code

-> Sem r (Error Text) 

Returns an IETF language tag of the language preferred in the country, which should be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown

sendPhoneNumberVerificationCode Source #

Arguments

:: Member TDLib r 
=> T

The phone number of the user, in international format

-> PhoneNumberAuthenticationSettings

Settings for the authentication of the user's phone number

-> Sem r (Error AuthenticationCodeInfo) 

Sends a code to verify a phone number to be added to a user's Telegram Passport

resendPhoneNumberVerificationCode :: Member TDLib r => Sem r (Error AuthenticationCodeInfo) Source #

Re-sends the code to verify a phone number to be added to a user's Telegram Passport

checkPhoneNumberVerificationCode Source #

Arguments

:: Member TDLib r 
=> T

Verification code

-> Sem r (Error Ok) 

Checks the phone number verification code for Telegram Passport

sendEmailAddressVerificationCode Source #

Arguments

:: Member TDLib r 
=> T

Email address

-> Sem r (Error EmailAddressAuthenticationCodeInfo) 

Sends a code to verify an email address to be added to a user's Telegram Passport

resendEmailAddressVerificationCode :: Member TDLib r => Sem r (Error EmailAddressAuthenticationCodeInfo) Source #

Re-sends the code to verify an email address to be added to a user's Telegram Passport

checkEmailAddressVerificationCode Source #

Arguments

:: Member TDLib r 
=> T

Verification code

-> Sem r (Error Ok) 

Checks the email address verification code for Telegram Passport

getPassportAuthorizationForm Source #

Arguments

:: Member TDLib r 
=> I32

User identifier of the service's bot

-> T

Telegram Passport element types requested by the service

-> T

Service's public_key

-> T

Authorization form nonce provided by the service

-> Sem r (Error PassportAuthorizationForm) 

Returns a Telegram Passport authorization form for sharing data with a service

getPassportAuthorizationFormAvailableElements Source #

Arguments

:: Member TDLib r 
=> I32

Authorization form identifier

-> T

Password of the current user

-> Sem r (Error PassportElementsWithErrors) 

Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization form. Result can be received only once for each authorization form

sendPassportAuthorizationForm Source #

Arguments

:: Member TDLib r 
=> I32

Authorization form identifier

-> [PassportElementType]

Types of Telegram Passport elements chosen by user to complete the authorization form

-> Sem r (Error Ok) 

Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements need to be used

sendPhoneNumberConfirmationCode Source #

Arguments

:: Member TDLib r 
=> T

Value of the "hash" parameter from the link

-> T

Value of the "phone" parameter from the link

-> PhoneNumberAuthenticationSettings

Settings for the authentication of the user's phone number

-> Sem r (Error AuthenticationCodeInfo) 

Sends phone number confirmation code. Should be called when user presses "https://t.me/confirmphone?phone=*******&hash=**********" or "tg://confirmphone?phone=*******&hash=**********" link

resendPhoneNumberConfirmationCode :: Member TDLib r => Sem r (Error AuthenticationCodeInfo) Source #

Resends phone number confirmation code

checkPhoneNumberConfirmationCode Source #

Arguments

:: Member TDLib r 
=> T

The phone number confirmation code

-> Sem r (Error Ok) 

Checks phone number confirmation code

setBotUpdatesStatus Source #

Arguments

:: Member TDLib r 
=> I32

The number of pending updates

-> T

The last error message

-> Sem r (Error Ok) 

Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only

uploadStickerFile Source #

Arguments

:: Member TDLib r 
=> I32

Sticker file owner

-> InputFile

PNG image with the sticker; must be up to 512 KB in size and fit in 512x512 square

-> Sem r (Error File) 

Uploads a PNG image with a sticker; for bots only; returns the uploaded file

createNewStickerSet Source #

Arguments

:: Member TDLib r 
=> I32

Sticker set owner

-> T

Sticker set title; 1-64 characters

-> T

Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_username"* (*bot_username* is case insensitive); 1-64 characters

-> Bool

True, if stickers are masks. Animated stickers can't be masks

-> [InputSticker]

List of stickers to be added to the set; must be non-empty. All stickers must be of the same type

-> Sem r (Error StickerSet) 

Creates a new sticker set; for bots only. Returns the newly created sticker set

addStickerToSet Source #

Arguments

:: Member TDLib r 
=> I32

Sticker set owner

-> T

Sticker set name

-> InputSticker

Sticker to add to the set

-> Sem r (Error StickerSet) 

Adds a new sticker to a set; for bots only. Returns the sticker set

setStickerSetThumbnail Source #

Arguments

:: Member TDLib r 
=> I32

Sticker set owner

-> T

Sticker set name

-> InputFile

Thumbnail to set in PNG or TGS format. Animated thumbnail must be set for animated sticker sets and only for them. You can use a zero InputFileId to delete the thumbnail

-> Sem r (Error StickerSet) 

Sets a sticker set thumbnail; for bots only. Returns the sticker set

setStickerPositionInSet Source #

Arguments

:: Member TDLib r 
=> InputFile

Sticker

-> I32

New position of the sticker in the set, zero-based

-> Sem r (Error Ok) 

Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot

removeStickerFromSet Source #

Arguments

:: Member TDLib r 
=> InputFile

Sticker

-> Sem r (Error Ok) 

Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot

getMapThumbnailFile Source #

Arguments

:: Member TDLib r 
=> Location

Location of the map center

-> I32

Map zoom level; 13-20

-> I32

Map width in pixels before applying scale; 16-1024

-> I32

Map height in pixels before applying scale; 16-1024

-> I32

Map scale; 1-3

-> I53

Identifier of a chat, in which the thumbnail will be shown. Use 0 if unknown

-> Sem r (Error File) 

Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded

acceptTermsOfService Source #

Arguments

:: Member TDLib r 
=> T

Terms of service identifier

-> Sem r (Error Ok) 

Accepts Telegram terms of services

sendCustomRequest Source #

Arguments

:: Member TDLib r 
=> T

The method name

-> T

JSON-serialized method parameters

-> Sem r (Error CustomRequestResult) 

Sends a custom request; for bots only

answerCustomQuery Source #

Arguments

:: Member TDLib r 
=> I64

Identifier of a custom query

-> T

JSON-serialized answer to the query

-> Sem r (Error Ok) 

Answers a custom query; for bots only

setAlarm Source #

Arguments

:: Member TDLib r 
=> Double

Number of seconds before the function returns

-> Sem r (Error Ok) 

Succeeds after a specified amount of time has passed. Can be called before authorization. Can be called before initialization

getCountryCode :: Member TDLib r => Sem r (Error Text) Source #

Uses current user IP address to found their country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization

getInviteText :: Member TDLib r => Sem r (Error Text) Source #

Returns the default text for invitation messages to be used as a placeholder when the current user invites friends to Telegram

getDeepLinkInfo Source #

Arguments

:: Member TDLib r 
=> T

The link

-> Sem r (Error DeepLinkInfo) 

Returns information about a tg:/ deep link. Use "tg:/need_update_for_some_feature" or "tg:some_unsupported_feature" for testing. Returns a 404 error for unknown links. Can be called before authorization

getApplicationConfig :: Member TDLib r => Sem r (Error JsonValue) Source #

Returns application config, provided by the server. Can be called before authorization

saveApplicationLogEvent Source #

Arguments

:: Member TDLib r 
=> T

Event type

-> I53

Optional chat identifier, associated with the event

-> JsonValue

The log event data

-> Sem r (Error Ok) 

Saves application log event on the server. Can be called before authorization

addProxy Source #

Arguments

:: Member TDLib r 
=> T

Proxy server IP address

-> I32

Proxy server port

-> Bool

True, if the proxy should be enabled

-> ProxyType

Proxy type

-> Sem r (Error Proxy) 

Adds a proxy server for network requests. Can be called before authorization

editProxy Source #

Arguments

:: Member TDLib r 
=> I32

Proxy identifier

-> T

Proxy server IP address

-> I32

Proxy server port

-> Bool

True, if the proxy should be enabled

-> ProxyType

Proxy type

-> Sem r (Error Proxy) 

Edits an existing proxy server for network requests. Can be called before authorization

enableProxy Source #

Arguments

:: Member TDLib r 
=> I32

Proxy identifier

-> Sem r (Error Ok) 

Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization

disableProxy :: Member TDLib r => Sem r (Error Ok) Source #

Disables the currently enabled proxy. Can be called before authorization

removeProxy Source #

Arguments

:: Member TDLib r 
=> I32

Proxy identifier

-> Sem r (Error Ok) 

Removes a proxy server. Can be called before authorization

getProxies :: Member TDLib r => Sem r (Error Proxies) Source #

Returns list of proxies that are currently set up. Can be called before authorization

getProxyLink Source #

Arguments

:: Member TDLib r 
=> I32

Proxy identifier

-> Sem r (Error Text) 

Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization

pingProxy Source #

Arguments

:: Member TDLib r 
=> I32

Proxy identifier. Use 0 to ping a Telegram server without a proxy

-> Sem r (Error Seconds) 

Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization

setLogStream Source #

Arguments

:: Member TDLib r 
=> LogStream

New log stream

-> Sem r (Error Ok) 

Sets new log stream for internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously

getLogStream :: Member TDLib r => Sem r (Error LogStream) Source #

Returns information about currently used log stream for internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously

setLogVerbosityLevel Source #

Arguments

:: Member TDLib r 
=> I32

New value of the verbosity level for logging. Value 0 corresponds to fatal errors, value 1 corresponds to errors, value 2 corresponds to warnings and debug warnings, value 3 corresponds to informational, value 4 corresponds to debug, value 5 corresponds to verbose debug, value greater than 5 and up to 1023 can be used to enable even more logging

-> Sem r (Error Ok) 

Sets the verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously

getLogVerbosityLevel :: Member TDLib r => Sem r (Error LogVerbosityLevel) Source #

Returns current verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously

getLogTags :: Member TDLib r => Sem r (Error LogTags) Source #

Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. This is an offline method. Can be called before authorization. Can be called synchronously

setLogTagVerbosityLevel Source #

Arguments

:: Member TDLib r 
=> T

Logging tag to change verbosity level

-> I32

New verbosity level; 1-1024

-> Sem r (Error Ok) 

Sets the verbosity level for a specified TDLib internal log tag. This is an offline method. Can be called before authorization. Can be called synchronously

getLogTagVerbosityLevel Source #

Arguments

:: Member TDLib r 
=> T

Logging tag to change verbosity level

-> Sem r (Error LogVerbosityLevel) 

Returns current verbosity level for a specified TDLib internal log tag. This is an offline method. Can be called before authorization. Can be called synchronously

addLogMessage Source #

Arguments

:: Member TDLib r 
=> I32

The minimum verbosity level needed for the message to be logged, 0-1023

-> T

Text of a message to log

-> Sem r (Error Ok) 

Adds a message to TDLib internal log. This is an offline method. Can be called before authorization. Can be called synchronously

testCallEmpty :: Member TDLib r => Sem r (Error Ok) Source #

Does nothing; for testing only. This is an offline method. Can be called before authorization

testCallString Source #

Arguments

:: Member TDLib r 
=> T

String to return

-> Sem r (Error TestString) 

Returns the received string; for testing only. This is an offline method. Can be called before authorization

testCallBytes Source #

Arguments

:: Member TDLib r 
=> ByteString64

Bytes to return

-> Sem r (Error TestBytes) 

Returns the received bytes; for testing only. This is an offline method. Can be called before authorization

testCallVectorInt Source #

Arguments

:: Member TDLib r 
=> [I32]

Vector of numbers to return

-> Sem r (Error TestVectorInt) 

Returns the received vector of numbers; for testing only. This is an offline method. Can be called before authorization

testCallVectorIntObject Source #

Arguments

:: Member TDLib r 
=> [TestInt]

Vector of objects to return

-> Sem r (Error TestVectorIntObject) 

Returns the received vector of objects containing a number; for testing only. This is an offline method. Can be called before authorization

testCallVectorString Source #

Arguments

:: Member TDLib r 
=> [T]

Vector of strings to return

-> Sem r (Error TestVectorString) 

Returns the received vector of strings; for testing only. This is an offline method. Can be called before authorization

testCallVectorStringObject Source #

Arguments

:: Member TDLib r 
=> [TestString]

Vector of objects to return

-> Sem r (Error TestVectorStringObject) 

Returns the received vector of objects containing a string; for testing only. This is an offline method. Can be called before authorization

testSquareInt Source #

Arguments

:: Member TDLib r 
=> I32

Number to square

-> Sem r (Error TestInt) 

Returns the squared received number; for testing only. This is an offline method. Can be called before authorization

testNetwork :: Member TDLib r => Sem r (Error Ok) Source #

Sends a simple network request to the Telegram servers; for testing only. Can be called before authorization

testProxy Source #

Arguments

:: Member TDLib r 
=> T

Proxy server IP address

-> I32

Proxy server port

-> ProxyType

Proxy type

-> I32

Identifier of a datacenter, with which to test connection

-> Double

The maximum overall timeout for the request

-> Sem r (Error Ok) 

Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization

testGetDifference :: Member TDLib r => Sem r (Error Ok) Source #

Forces an updates.getDifference call to the Telegram servers; for testing only

testUseUpdate :: Member TDLib r => Sem r (Error Update) Source #

Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorization

testReturnError Source #

Arguments

:: Member TDLib r 
=> Error

The error to be returned

-> Sem r (Error Error) 

Returns the specified error and ensures that the Error object is used; for testing only. This is an offline method. Can be called before authorization. Can be called synchronously