Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from federico-barreraoro/master
Browse files Browse the repository at this point in the history
Getting the same response in the sendMessage
  • Loading branch information
panizzag authored Apr 6, 2020
2 parents 3037a11 + 71123a4 commit 9e35636
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ src/main/api/.repository/
src/main/api/.gitignore
velocity.log
target/
.idea/
.idea/
bin/
.settings/
.project
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public final class TelegramConnection {
private static final Logger LOGGER = LoggerFactory.getLogger(TelegramConnection.class);
private TelegramConfiguration genConfig;
private HttpClient httpClient;
private HttpRequestBuilder httpRequestBuilder;

public TelegramConnection(HttpService httpService, TelegramConfiguration gConfig) {
genConfig = gConfig;
Expand All @@ -37,7 +36,6 @@ public void initHttpClient(HttpService httpService){
HttpClientConfiguration.Builder builder = new HttpClientConfiguration.Builder();
builder.setName("telegram");
httpClient = httpService.getClientFactory().create(builder.build());
httpRequestBuilder = HttpRequest.builder();
httpClient.start();
}

Expand All @@ -57,7 +55,7 @@ public InputStream sendMessage(String chatId, String message){
qParams.put("chat_id", chatId);
qParams.put("text", message);

HttpRequest request = httpRequestBuilder
HttpRequest request = HttpRequest.builder()
.method("GET")
.uri(strUri)
.queryParams(qParams)
Expand All @@ -73,6 +71,7 @@ public InputStream sendMessage(String chatId, String message){
} catch (Exception e) {
e.printStackTrace();
}

return null;
}

Expand All @@ -86,7 +85,7 @@ public InputStream getUpdates(String chatId, boolean watermark, String lastUpdat
qParams.put("offset", lastUpdateId);
}

HttpRequest request = httpRequestBuilder
HttpRequest request = HttpRequest.builder()
.method("GET")
.uri(strUri)
.queryParams(qParams)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class UpdatesListener extends PollingSource<String, Void> {


@Parameter
@Optional
protected String chatId;

@Parameter
Expand Down

0 comments on commit 9e35636

Please sign in to comment.