Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="JTelegramBot Builders/src"/>
<classpathentry kind="src" path="JTelegramBot Core/src"/>
<classpathentry kind="src" path="JTelegramBot Webhook/src"/>
<classpathentry kind="lib" path="jars/JTelegramBot-Builders-v1.0.jar"/>
<classpathentry kind="lib" path="jars/JTelegramBot-Builders-v1.1.jar"/>
<classpathentry kind="lib" path="jars/JTelegramBot-Core-v1.0.jar"/>
<classpathentry kind="lib" path="jars/JTelegramBot-Core-v1.1.jar"/>
<classpathentry kind="lib" path="jars/JTelegramBot-Webhook-v1.0.jar"/>
<classpathentry kind="lib" path="JTelegramBot Core/libs/commons-logging-1.2.jar"/>
<classpathentry kind="lib" path="JTelegramBot Core/libs/jackson-annotations-2.7.2.jar"/>
<classpathentry kind="lib" path="JTelegramBot Core/libs/jackson-core-2.7.2.jar"/>
<classpathentry kind="lib" path="JTelegramBot Core/libs/jackson-databind-2.7.2.jar"/>
<classpathentry kind="lib" path="JTelegramBot Webhook/libs/netty-all-4.0.34.Final.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>JTelegramBot</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
2 changes: 1 addition & 1 deletion JTelegramBot Core/src/io/fouad/jtb/core/JTelegramBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ public BooleanOrMessageResult editMessageText(ChatIdentifier targetChatIdentifie
if(inlineKeyboardMarkup != null) formFields.add(new NameValueParameter<String, String>("reply_markup", JsonUtils.toJson(inlineKeyboardMarkup)));

HttpResponse response = HttpClient.sendHttpPost(API_URL_PREFIX + apiToken + "/editMessageText", formFields);
TelegramResult<String> telegramResult = JsonUtils.toJavaObject(response.getResponseBody(), new TypeReference<TelegramResult<String>>(){});
TelegramResult<Message> telegramResult = JsonUtils.toJavaObject(response.getResponseBody(), new TypeReference<TelegramResult<Message>>(){});

if(!telegramResult.isOk()) throw new NegativeResponseException(response.getHttpStatusCode(), telegramResult);

Expand Down
98 changes: 63 additions & 35 deletions JTelegramBot Core/src/io/fouad/jtb/core/beans/CallbackQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class CallbackQuery
@JsonProperty("message")
private Message message;

@JsonProperty("chat_instance")
private String chat_instance;
/**
* Optional. Identifier of the message sent via the bot in
* inline mode, that originated the query.
Expand All @@ -73,58 +75,84 @@ public class CallbackQuery

public CallbackQuery(){}

public CallbackQuery(String id, User from, Message message, String inline_message_id, String data)
public CallbackQuery(String id, User from, Message message, String inline_message_id, String data, String chat_instance)
{
this.id = id;
this.from = from;
this.message = message;
this.inline_message_id = inline_message_id;
this.data = data;
this.chat_instance=chat_instance;
}

public String getId(){return id;}
public User getFrom(){return from;}
public Message getMessage(){return message;}
public String getInline_message_id(){return inline_message_id;}
public String getData(){return data;}

public String getchat_instance(){return chat_instance;}

@Override
public boolean equals(Object o)
{
if(this == o) return true;
if(!(o instanceof CallbackQuery)) return false;

CallbackQuery that = (CallbackQuery) o;

if(id != null ? !id.equals(that.id) : that.id != null) return false;
if(from != null ? !from.equals(that.from) : that.from != null) return false;
if(message != null ? !message.equals(that.message) : that.message != null) return false;
if(inline_message_id != null ? !inline_message_id.equals(that.inline_message_id)
: that.inline_message_id != null) return false;
return data != null ? data.equals(that.data) : that.data == null;

public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((chat_instance == null) ? 0 : chat_instance.hashCode());
result = prime * result + ((data == null) ? 0 : data.hashCode());
result = prime * result + ((from == null) ? 0 : from.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((inline_message_id == null) ? 0 : inline_message_id.hashCode());
result = prime * result + ((message == null) ? 0 : message.hashCode());
return result;
}

@Override
public int hashCode()
{
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (from != null ? from.hashCode() : 0);
result = 31 * result + (message != null ? message.hashCode() : 0);
result = 31 * result + (inline_message_id != null ? inline_message_id.hashCode() : 0);
result = 31 * result + (data != null ? data.hashCode() : 0);
return result;
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CallbackQuery other = (CallbackQuery) obj;
if (chat_instance == null) {
if (other.chat_instance != null)
return false;
} else if (!chat_instance.equals(other.chat_instance))
return false;
if (data == null) {
if (other.data != null)
return false;
} else if (!data.equals(other.data))
return false;
if (from == null) {
if (other.from != null)
return false;
} else if (!from.equals(other.from))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (inline_message_id == null) {
if (other.inline_message_id != null)
return false;
} else if (!inline_message_id.equals(other.inline_message_id))
return false;
if (message == null) {
if (other.message != null)
return false;
} else if (!message.equals(other.message))
return false;
return true;
}

@Override
public String toString()
{
return "CallbackQuery{" +
"id='" + id + '\'' +
", from=" + from +
", message=" + message +
", inline_message_id='" + inline_message_id + '\'' +
", data='" + data + '\'' +
'}';
public String toString() {
return "CallbackQuery [id=" + id + ", from=" + from + ", message=" + message + ", chat_instance=" + chat_instance
+ ", inline_message_id=" + inline_message_id + ", data=" + data + "]";
}



}
Binary file modified jars/JTelegramBot-Core-v1.1.jar
Binary file not shown.