1. Enabled html parse_mode

This commit is contained in:
Rubenlagu 2016-01-20 20:19:27 +01:00 committed by Rubenlagus
parent 25d11ecadc
commit 603890a2a6
6 changed files with 76 additions and 12 deletions

View File

@ -83,6 +83,14 @@ public class SendMessage extends BotApiMethod<Message> {
}
}
public void enableHtml(boolean enable) {
if (enable) {
this.parseMode = "html";
} else {
this.parseMode = null;
}
}
@Override
public JSONObject toJson() {
JSONObject jsonObject = new JSONObject();

View File

@ -89,11 +89,19 @@ public class InlineQueryResultArticle implements InlineQueryResult {
this.parseMode = parseMode;
}
public void setMarkdown(boolean enabled) {
if (enabled) {
parseMode = "Markdown";
public void enableMarkdown(boolean enable) {
if (enable) {
this.parseMode = "Markdown";
} else {
parseMode = null;
this.parseMode = null;
}
}
public void enableHtml(boolean enable) {
if (enable) {
this.parseMode = "html";
} else {
this.parseMode = null;
}
}

View File

@ -83,8 +83,20 @@ public class InlineQueryResultGif implements InlineQueryResult {
return parseMode;
}
public void setParseMode(String parseMode) {
this.parseMode = parseMode;
public void enableMarkdown(boolean enable) {
if (enable) {
this.parseMode = "Markdown";
} else {
this.parseMode = null;
}
}
public void enableHtml(boolean enable) {
if (enable) {
this.parseMode = "html";
} else {
this.parseMode = null;
}
}
public Boolean getDisableWebPagePreview() {

View File

@ -84,8 +84,20 @@ public class InlineQueryResultMpeg4Gif implements InlineQueryResult {
return parseMode;
}
public void setParseMode(String parseMode) {
this.parseMode = parseMode;
public void enableMarkdown(boolean enable) {
if (enable) {
this.parseMode = "Markdown";
} else {
this.parseMode = null;
}
}
public void enableHtml(boolean enable) {
if (enable) {
this.parseMode = "html";
} else {
this.parseMode = null;
}
}
public Boolean getDisableWebPagePreview() {

View File

@ -89,8 +89,20 @@ public class InlineQueryResultPhoto implements InlineQueryResult {
return parseMode;
}
public void setParseMode(String parseMode) {
this.parseMode = parseMode;
public void enableMarkdown(boolean enable) {
if (enable) {
this.parseMode = "Markdown";
} else {
this.parseMode = null;
}
}
public void enableHtml(boolean enable) {
if (enable) {
this.parseMode = "html";
} else {
this.parseMode = null;
}
}
public Boolean getDisableWebPagePreview() {

View File

@ -88,8 +88,20 @@ public class InlineQueryResultVideo implements InlineQueryResult {
return parseMode;
}
public void setParseMode(String parseMode) {
this.parseMode = parseMode;
public void enableMarkdown(boolean enable) {
if (enable) {
this.parseMode = "Markdown";
} else {
this.parseMode = null;
}
}
public void enableHtml(boolean enable) {
if (enable) {
this.parseMode = "html";
} else {
this.parseMode = null;
}
}
public Boolean getDisableWebPagePreview() {