Example #1
0
 /// <summary>
 /// Returns all active sessions of the current user
 /// </summary>
 public static Task <Sessions> GetActiveSessionsAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetActiveSessions
     {
     }));
 }
 /// <summary>
 /// Re-sends the code to verify a phone number to be added to a user's Telegram Passport
 /// </summary>
 public static Task <AuthenticationCodeInfo> ResendPhoneNumberVerificationCodeAsync(this Client client)
 {
     return(client.ExecuteAsync(new ResendPhoneNumberVerificationCode
     {
     }));
 }
 /// <summary>
 /// Quickly returns approximate storage usage statistics. Can be called before authorization
 /// </summary>
 public static Task <StorageStatisticsFast> GetStorageStatisticsFastAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetStorageStatisticsFast
     {
     }));
 }
Example #4
0
 /// <summary>
 /// 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
 /// </summary>
 public static Task <Ok> DestroyAsync(this Client client)
 {
     return(client.ExecuteAsync(new Destroy
     {
     }));
 }
Example #5
0
 /// <summary>
 /// 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
 /// </summary>
 public static Task <Ok> ResendAuthenticationCodeAsync(this Client client)
 {
     return(client.ExecuteAsync(new ResendAuthenticationCode
     {
     }));
 }
Example #6
0
 /// <summary>
 /// Uses current user IP to found their country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization
 /// </summary>
 public static Task <Text> GetCountryCodeAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetCountryCode
     {
     }));
 }
Example #7
0
 /// <summary>
 /// 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
 /// </summary>
 public static Task <Chats> GetSuitableDiscussionChatsAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetSuitableDiscussionChats
     {
     }));
 }
Example #8
0
 /// <summary>
 /// Returns current verbosity level of the internal logging of TDLib. This is an offline method. Can be called before authorization. Can be called synchronously
 /// </summary>
 public static Task <LogVerbosityLevel> GetLogVerbosityLevelAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetLogVerbosityLevel
     {
     }));
 }
Example #9
0
 /// <summary>
 /// Returns the default text for invitation messages to be used as a placeholder when the current user invites friends to Telegram
 /// </summary>
 public static Task <Text> GetInviteTextAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetInviteText
     {
     }));
 }
Example #10
0
 /// <summary>
 /// Returns a user that can be contacted to get support
 /// </summary>
 public static Task <User> GetSupportUserAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetSupportUser
     {
     }));
 }
Example #11
0
 /// <summary>
 /// Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorization
 /// </summary>
 public static Task <Update> TestUseUpdateAsync(this Client client)
 {
     return(client.ExecuteAsync(new TestUseUpdate
     {
     }));
 }
 /// <summary>
 /// Returns information about the current temporary password
 /// </summary>
 public static Task <TemporaryPasswordState> GetTemporaryPasswordStateAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetTemporaryPasswordState
     {
     }));
 }
Example #13
0
 /// <summary>
 /// Checks whether the current session can be used to transfer a chat ownership to another user
 /// </summary>
 public static Task <CanTransferOwnershipResult> CanTransferOwnershipAsync(this Client client)
 {
     return(client.ExecuteAsync(new CanTransferOwnership
     {
     }));
 }
Example #14
0
 /// <summary>
 /// Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state
 /// </summary>
 public static Task <AuthorizationState> GetAuthorizationStateAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetAuthorizationState
     {
     }));
 }
Example #15
0
 /// <summary>
 /// Resets list of installed backgrounds to its default value
 /// </summary>
 public static Task <Ok> ResetBackgroundsAsync(this Client client)
 {
     return(client.ExecuteAsync(new ResetBackgrounds
     {
     }));
 }
 /// <summary>
 /// Resends the 2-step verification recovery email address verification code
 /// </summary>
 public static Task <PasswordState> ResendRecoveryEmailAddressCodeAsync(this Client client)
 {
     return(client.ExecuteAsync(new ResendRecoveryEmailAddressCode
     {
     }));
 }
Example #17
0
 /// <summary>
 /// Sends a simple network request to the Telegram servers; for testing only. Can be called before authorization
 /// </summary>
 public static Task <Ok> TestNetworkAsync(this Client client)
 {
     return(client.ExecuteAsync(new TestNetwork
     {
     }));
 }
 /// <summary>
 /// 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
 /// </summary>
 public static Task <Ok> ResetAllNotificationSettingsAsync(this Client client)
 {
     return(client.ExecuteAsync(new ResetAllNotificationSettings
     {
     }));
 }
Example #19
0
 /// <summary>
 /// Clears all imported contacts, contact list remains unchanged
 /// </summary>
 public static Task <Ok> ClearImportedContactsAsync(this Client client)
 {
     return(client.ExecuteAsync(new ClearImportedContacts
     {
     }));
 }
Example #20
0
 /// <summary>
 /// 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
 /// </summary>
 public static Task <Ok> LogOutAsync(this Client client)
 {
     return(client.ExecuteAsync(new LogOut
     {
     }));
 }
Example #21
0
 /// <summary>
 /// Returns the total number of imported contacts
 /// </summary>
 public static Task <Count> GetImportedContactCountAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetImportedContactCount
     {
     }));
 }
 /// <summary>
 /// Terminates all other sessions of the current user
 /// </summary>
 public static Task <Ok> TerminateAllOtherSessionsAsync(this Client client)
 {
     return(client.ExecuteAsync(new TerminateAllOtherSessions
     {
     }));
 }
Example #23
0
 /// <summary>
 /// Returns the current user
 /// </summary>
 public static Task <User> GetMeAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetMe
     {
     }));
 }
Example #24
0
 /// <summary>
 /// Returns saved order info, if any
 /// </summary>
 public static Task <OrderInfo> GetSavedOrderInfoAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetSavedOrderInfo
     {
     }));
 }