Skip to content

There is no next step where you run example/Example.java #91

Closed

Description

@iselien
2022-05-20 14:25:59.039  INFO 14676 TelegramClient       : Registered new client 1
[login] Do you want to login using a bot [token], a [phone] number, or a [qr] code? [token/phone/qr]: phone
[login] Please type your phone number: +8617679391**

no more

Which document shoud I read to use this program?
I feel terrible.

Activity

  1. cavallium commented on May 20, 2022

    @cavallium
    Member

    Is that phone number associated with an existing telegram user? I don't remember if the example doesn't support new user creation.

  2. cavallium commented on May 20, 2022

    @cavallium
    Member

    Do you encounter this problem with other users? Or only that one?

  3. iselien commented on May 21, 2022

    @iselien
    Author

    I tried both numbers and they had the same effect

  4. iselien commented on May 21, 2022

    @iselien
    Author

    Since I'm in China and I don't know how its API works with proxy, I use it like this:

    	public static void main(String[] args) throws CantLoadLibrary, InterruptedException {
    		System.setProperty("http.proxySet", "true");
    		System.setProperty("http.proxyHost", "127.0.0.1");
    		System.setProperty("http.proxyPort", "10809");
    		// Initialize TDLight native libraries
    		Init.start();
    
    		// Obtain the API token
    		var apiToken = new APIToken(164**95, "dc983****a7d81db4e0");
    
    		// Configure the client
    		var settings = TDLibSettings.create(apiToken);
    
  5. cavallium commented on May 21, 2022

    @cavallium
    Member

    Telegram doesn't use the jvm proxy properties, it uses its own proxy settings.

  6. eaglekindoms commented on May 22, 2022

    @eaglekindoms

    @yovelas you can use this function to use proxy, after start the client.
    like this:

    // Start the client
            client.start(authenticationData);
            TdApi.AddProxy proxy = new TdApi.AddProxy(
                    "127.0.0.1", 10809, true, new TdApi.ProxyTypeHttp()
            );
            client.send(proxy, result -> {
                System.out.println(result.get());
            });
    
  7. iselien commented on May 22, 2022

    @iselien
    Author

    Thank you. Problem solved.

  8. locked and limited conversation to collaborators on May 22, 2022
  9. converted this issue into a discussion #92 on May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions