-
Hello,I don't find proxy example, public void init() throws CantLoadLibrary, InterruptedException {
Init.start();
APIToken apiToken = APIToken.example();
TDLibSettings settings = TDLibSettings.create(apiToken);
TdApi.AddProxy proxy = new TdApi.AddProxy("127.0.0.1", 7890, true, new TdApi.ProxyTypeHttp());
client = new SimpleTelegramClient(settings);
client.execute(proxy);
// Configure the authentication info
var authenticationData = AuthenticationData.consoleLogin();
// Add an example update handler that prints when the bot is started
client.addUpdateHandler(TdApi.UpdateAuthorizationState.class, TelegramClient::onUpdateAuthorizationState);
// Add an example update handler that prints every received message
client.addUpdateHandler(TdApi.UpdateNewMessage.class, TelegramClient::onUpdateNewMessage);
// Add an example command handler that stops the bot
client.addCommandHandler("stop", new StopCommandHandler());
// Start the client
client.start(authenticationData);
// Wait for exit
client.waitForExit();
} have any solution? |
Beta Was this translation helpful? Give feedback.
Answered by
SLiGe
Mar 10, 2023
Replies: 2 comments
-
Proxy |
Beta Was this translation helpful? Give feedback.
0 replies
-
just do this: client.start(authenticationData);
client.send(proxy, result -> {
System.out.println(result.isError());
System.out.println(result.get());
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
SLiGe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
just do this: