コード例 #1
0
ファイル: GetActiveSessions.cs プロジェクト: studasd/tdsharp
 /// <summary>
 /// Returns all active sessions of the current user
 /// </summary>
 public static Task <Sessions> GetActiveSessionsAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetActiveSessions
     {
     }));
 }
コード例 #2
0
 /// <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
     {
     }));
 }
コード例 #3
0
 /// <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
     {
     }));
 }
コード例 #4
0
ファイル: Destroy.cs プロジェクト: studasd/tdsharp
 /// <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
     {
     }));
 }
コード例 #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
     {
     }));
 }
コード例 #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
     {
     }));
 }
コード例 #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
     {
     }));
 }
コード例 #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
     {
     }));
 }
コード例 #9
0
ファイル: GetInviteText.cs プロジェクト: studasd/tdsharp
 /// <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
     {
     }));
 }
コード例 #10
0
ファイル: GetSupportUser.cs プロジェクト: studasd/tdsharp
 /// <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
     {
     }));
 }
コード例 #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
     {
     }));
 }
コード例 #12
0
 /// <summary>
 /// Returns information about the current temporary password
 /// </summary>
 public static Task <TemporaryPasswordState> GetTemporaryPasswordStateAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetTemporaryPasswordState
     {
     }));
 }
コード例 #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
     {
     }));
 }
コード例 #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
     {
     }));
 }
コード例 #15
0
ファイル: ResetBackgrounds.cs プロジェクト: studasd/tdsharp
 /// <summary>
 /// Resets list of installed backgrounds to its default value
 /// </summary>
 public static Task <Ok> ResetBackgroundsAsync(this Client client)
 {
     return(client.ExecuteAsync(new ResetBackgrounds
     {
     }));
 }
コード例 #16
0
 /// <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
     {
     }));
 }
コード例 #17
0
ファイル: TestNetwork.cs プロジェクト: studasd/tdsharp
 /// <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
     {
     }));
 }
コード例 #18
0
 /// <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
     {
     }));
 }
コード例 #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
     {
     }));
 }
コード例 #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
     {
     }));
 }
コード例 #21
0
 /// <summary>
 /// Returns the total number of imported contacts
 /// </summary>
 public static Task <Count> GetImportedContactCountAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetImportedContactCount
     {
     }));
 }
コード例 #22
0
 /// <summary>
 /// Terminates all other sessions of the current user
 /// </summary>
 public static Task <Ok> TerminateAllOtherSessionsAsync(this Client client)
 {
     return(client.ExecuteAsync(new TerminateAllOtherSessions
     {
     }));
 }
コード例 #23
0
ファイル: GetMe.cs プロジェクト: studasd/tdsharp
 /// <summary>
 /// Returns the current user
 /// </summary>
 public static Task <User> GetMeAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetMe
     {
     }));
 }
コード例 #24
0
 /// <summary>
 /// Returns saved order info, if any
 /// </summary>
 public static Task <OrderInfo> GetSavedOrderInfoAsync(this Client client)
 {
     return(client.ExecuteAsync(new GetSavedOrderInfo
     {
     }));
 }