Merge pull request #66 from rubenlagus/dev

Dev
This commit is contained in:
Ruben Bermudez 2016-05-05 22:40:44 +02:00
commit e0076ebf8b
4 changed files with 24 additions and 7 deletions

View File

@ -64,7 +64,7 @@ You can see code for those bots at [TelegramBotsExample](https://github.com/rube
This library use [Telegram bot API](https://core.telegram.org/bots), you can find more information following the link.
## Questions or Suggestions
Feel free to create issues [here](https://github.com/rubenlagus/TelegramBots/issues) as you need
Feel free to create issues [here](https://github.com/rubenlagus/TelegramBots/issues) as you need or join the [chat](https://telegram.me/JavaBotsApi)
## License

View File

@ -6,9 +6,10 @@
<packaging>jar</packaging>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>2.2</version>
<version>2.3</version>
<name>Telegram Bots</name>
<url>https://telegram.me/JavaBotsApi</url>
<description>Easy to use library to create Telegram Bots</description>
<licenses>

View File

@ -47,6 +47,22 @@ public class Contact implements IBotApiObject {
}
}
public String getPhoneNumber() {
return phoneNumber;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public Integer getUserID() {
return userID;
}
@Override
public void serialize(JsonGenerator gen, SerializerProvider serializers) throws IOException {
gen.writeStartObject();

View File

@ -435,7 +435,7 @@ public abstract class AbsSender {
throw new TelegramApiException("Error at sendDocument", jsonObject.getString("description"));
}
return new Message(jsonObject);
return new Message(jsonObject.getJSONObject(Constants.RESPONSEFIELDRESULT));
}
public Message sendPhoto(SendPhoto sendPhoto) throws TelegramApiException {
@ -494,7 +494,7 @@ public abstract class AbsSender {
throw new TelegramApiException("Error at sendPhoto", jsonObject.getString("description"));
}
return new Message(jsonObject);
return new Message(jsonObject.getJSONObject(Constants.RESPONSEFIELDRESULT));
}
public Message sendVideo(SendVideo sendVideo) throws TelegramApiException {
@ -571,7 +571,7 @@ public abstract class AbsSender {
throw new TelegramApiException("Error at sendVideo", jsonObject.getString("description"));
}
return new Message(jsonObject);
return new Message(jsonObject.getJSONObject(Constants.RESPONSEFIELDRESULT));
}
public Message sendSticker(SendSticker sendSticker) throws TelegramApiException {
@ -625,7 +625,7 @@ public abstract class AbsSender {
throw new TelegramApiException("Error at sendSticker", jsonObject.getString("description"));
}
return new Message(jsonObject);
return new Message(jsonObject.getJSONObject(Constants.RESPONSEFIELDRESULT));
}
/**
@ -775,7 +775,7 @@ public abstract class AbsSender {
throw new TelegramApiException("Error at sendVoice", jsonObject.getString("description"));
}
return new Message(jsonObject);
return new Message(jsonObject.getJSONObject(Constants.RESPONSEFIELDRESULT));
}
// Simplified methods