From 848c228fead11c246f0c09cfdc079cd0d25f6c9b Mon Sep 17 00:00:00 2001 From: Rubenlagus Date: Thu, 5 May 2016 23:00:08 +0200 Subject: [PATCH 1/3] Close #46 --- .../result/InlineQueryResultLocation.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultLocation.java b/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultLocation.java index 7f4ddd93..28773b3d 100644 --- a/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultLocation.java +++ b/src/main/java/org/telegram/telegrambots/api/objects/inlinequery/result/InlineQueryResultLocation.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; + import org.json.JSONObject; import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputMessageContent; import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup; @@ -39,9 +40,9 @@ public class InlineQueryResultLocation implements InlineQueryResult { @JsonProperty(TITLE_FIELD) private String title; ///< Optional. Location title @JsonProperty(LATITUDE_FIELD) - private String latitude; ///< Location latitude in degrees + private Float latitude; ///< Location latitude in degrees @JsonProperty(LONGITUDE_FIELD) - private String longitude; ///< Location longitude in degrees + private Float longitude; ///< Location longitude in degrees @JsonProperty(REPLY_MARKUP_FIELD) private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message @JsonProperty(INPUTMESSAGECONTENT_FIELD) @@ -75,20 +76,20 @@ public class InlineQueryResultLocation implements InlineQueryResult { return this; } - public String getLatitude() { + public Float getLatitude() { return latitude; } - public InlineQueryResultLocation setLatitude(String latitude) { + public InlineQueryResultLocation setLatitude(Float latitude) { this.latitude = latitude; return this; } - public String getLongitude() { + public Float getLongitude() { return longitude; } - public InlineQueryResultLocation setLongitude(String longitude) { + public InlineQueryResultLocation setLongitude(Float longitude) { this.longitude = longitude; return this; } @@ -169,8 +170,8 @@ public class InlineQueryResultLocation implements InlineQueryResult { gen.writeStartObject(); gen.writeStringField(TYPE_FIELD, type); gen.writeStringField(ID_FIELD, id); - gen.writeStringField(LONGITUDE_FIELD, longitude); - gen.writeStringField(LATITUDE_FIELD, latitude); + gen.writeNumberField(LONGITUDE_FIELD, longitude); + gen.writeNumberField(LATITUDE_FIELD, latitude); gen.writeStringField(TITLE_FIELD, title); if (replyMarkup != null) { gen.writeObjectField(REPLY_MARKUP_FIELD, replyMarkup); From fd8e939f5465923e49c5aad81067c14d255756bc Mon Sep 17 00:00:00 2001 From: Rubenlagus Date: Thu, 5 May 2016 23:09:50 +0200 Subject: [PATCH 2/3] update version --- README.md | 2 +- badge.svg | 24 ++++++++++++++++++++++++ pom.xml | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 badge.svg diff --git a/README.md b/README.md index 6e70475e..5aecf10b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ I recommend using getUpdates methods. ## Usage -Just import add the library to your project using [Maven, Gradly, ...](https://jitpack.io/#rubenlagus/TelegramBots/v2.3) or download the jar(including all dependencies) from [here](https://github.com/rubenlagus/TelegramBots/releases/tag/v2.3) +Just import add the library to your project using [Maven, Gradly, ...](https://jitpack.io/#rubenlagus/TelegramBots/v2.3.1) or download the jar(including all dependencies) from [here](https://github.com/rubenlagus/TelegramBots/releases/tag/v2.3.1) In order to use Long Polling mode, just create your own bot extending `org.telegram.telegrambots.bots.TelegramLongPollingBot`. diff --git a/badge.svg b/badge.svg new file mode 100644 index 00000000..73163190 --- /dev/null +++ b/badge.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + chat + chat + on telegram + on telegram + + + diff --git a/pom.xml b/pom.xml index fd5c6387..60c77407 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ jar org.telegram telegrambots - 2.3 + 2.3.1 Telegram Bots https://telegram.me/JavaBotsApi From c8e1e907ad85b9003c218f5313da0f63ca6d150b Mon Sep 17 00:00:00 2001 From: Rubenlagus Date: Thu, 5 May 2016 23:27:56 +0200 Subject: [PATCH 3/3] Added Telegram badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5aecf10b..655638db 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Telegram Bot Java Library +[![Telegram](http://trellobot.doomdns.org/telegrambadge.svg)](https://telegram.me/JavaBotsApi) + A simple to use library to create Telegram Bots in Java ## Contributions