Fix typos and error messages
This commit is contained in:
parent
bdc8db3c87
commit
aa3e1fcf63
@ -18,7 +18,7 @@ public class TelegramBotsApi {
|
||||
private static final String webhookUrlFormat = "{0}callback/";
|
||||
private boolean useWebhook; ///< True to enable webhook usage
|
||||
private Webhook webhook; ///< Webhook instance
|
||||
private String extrenalUrl; ///< External url of the bots
|
||||
private String externalUrl; ///< External url of the bots
|
||||
private String pathToCertificate; ///< Path to public key certificate
|
||||
|
||||
/**
|
||||
@ -43,7 +43,7 @@ public class TelegramBotsApi {
|
||||
}
|
||||
|
||||
this.useWebhook = true;
|
||||
this.extrenalUrl = fixExternalUrl(externalUrl);
|
||||
this.externalUrl = fixExternalUrl(externalUrl);
|
||||
webhook = ApiContext.getInstance(Webhook.class);
|
||||
webhook.setInternalUrl(internalUrl);
|
||||
webhook.startServer();
|
||||
@ -71,7 +71,7 @@ public class TelegramBotsApi {
|
||||
}
|
||||
|
||||
this.useWebhook = true;
|
||||
this.extrenalUrl = fixExternalUrl(externalUrl);
|
||||
this.externalUrl = fixExternalUrl(externalUrl);
|
||||
webhook = ApiContext.getInstance(Webhook.class);
|
||||
webhook.setInternalUrl(internalUrl);
|
||||
webhook.setKeyStore(keyStore, keyStorePassword);
|
||||
@ -104,7 +104,7 @@ public class TelegramBotsApi {
|
||||
}
|
||||
|
||||
this.useWebhook = true;
|
||||
this.extrenalUrl = fixExternalUrl(externalUrl);
|
||||
this.externalUrl = fixExternalUrl(externalUrl);
|
||||
this.pathToCertificate = pathToCertificate;
|
||||
webhook = ApiContext.getInstance(Webhook.class);
|
||||
webhook.setInternalUrl(internalUrl);
|
||||
@ -133,7 +133,7 @@ public class TelegramBotsApi {
|
||||
public void registerBot(WebhookBot bot) throws TelegramApiRequestException {
|
||||
if (useWebhook) {
|
||||
webhook.registerWebhook(bot);
|
||||
bot.setWebhook(extrenalUrl + bot.getBotPath(), pathToCertificate);
|
||||
bot.setWebhook(externalUrl + bot.getBotPath(), pathToCertificate);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,13 +35,13 @@ public class AnswerCallbackQuery extends BotApiMethod<Boolean> {
|
||||
@JsonProperty(TEXT_FIELD)
|
||||
private String text; ///< Optional Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
|
||||
@JsonProperty(SHOWALERT_FIELD)
|
||||
private Boolean showAlert; ///< Optional. If true, an alert will be shown by the client instead of a notificaiton at the top of the chat screen. Defaults to false.
|
||||
private Boolean showAlert; ///< Optional. If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
|
||||
@JsonProperty(URL_FIELD)
|
||||
/**
|
||||
* Optional. URL that will be opened by the user's client.
|
||||
* If you have created a Game and accepted the conditions via @Botfather,
|
||||
* specify the URL that opens your game. Otherwise you may use links
|
||||
* InlineQueryResultGamelike telegram.me/your_bot?start=XXXX that open your bot with a parameter.
|
||||
* like telegram.me/your_bot?start=XXXX that open your bot with a parameter.
|
||||
*/
|
||||
private String url;
|
||||
@JsonProperty(CACHETIME_FIELD)
|
||||
|
@ -63,7 +63,7 @@ public class SetGameScore extends BotApiMethod<Serializable> {
|
||||
@JsonProperty(SCORE_FIELD)
|
||||
private Integer score; ///< New score, must be positive
|
||||
@JsonProperty(FORCE_FIELD)
|
||||
private Boolean force; ///< Opfional. Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
|
||||
private Boolean force; ///< Optional. Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
|
||||
|
||||
public SetGameScore() {
|
||||
super();
|
||||
|
@ -46,9 +46,9 @@ public class SendAnimation extends PartialBotApiMethod<Message> {
|
||||
*/
|
||||
private InputFile animation;
|
||||
private Integer duration; ///< Optional. Duration of sent animation in seconds
|
||||
private String caption; ///< OptionaL. Animation caption (may also be used when resending videos by file_id).
|
||||
private String caption; ///< Optional. Animation caption (may also be used when resending videos by file_id).
|
||||
private Integer width; ///< Optional. Animation width
|
||||
private Integer height; ///< OptionaL. Animation height
|
||||
private Integer height; ///< Optional. Animation height
|
||||
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
|
||||
private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message
|
||||
private ReplyKeyboard replyMarkup; ///< Optional. JSON-serialized object for a custom reply keyboard
|
||||
|
@ -39,9 +39,9 @@ public class SendVideo extends PartialBotApiMethod<Message> {
|
||||
private String chatId; ///< Unique identifier for the chat to send the message to (Or username for channels)
|
||||
private InputFile video; ///< Video to send. file_id as String to resend a video that is already on the Telegram servers or URL to upload it
|
||||
private Integer duration; ///< Optional. Duration of sent video in seconds
|
||||
private String caption; ///< OptionaL. Video caption (may also be used when resending videos by file_id).
|
||||
private String caption; ///< Optional. Video caption (may also be used when resending videos by file_id).
|
||||
private Integer width; ///< Optional. Video width
|
||||
private Integer height; ///< OptionaL. Video height
|
||||
private Integer height; ///< Optional. Video height
|
||||
private Boolean supportsStreaming; ///< Optional. Pass True, if the uploaded video is suitable for streaming
|
||||
private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound.
|
||||
private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message
|
||||
|
@ -164,7 +164,7 @@ public class CreateNewStickerSet extends PartialBotApiMethod<Boolean> {
|
||||
throw new TelegramApiValidationException("name can't be empty", this);
|
||||
}
|
||||
if (title == null || title.isEmpty()) {
|
||||
throw new TelegramApiValidationException("userId can't be empty", this);
|
||||
throw new TelegramApiValidationException("title can't be empty", this);
|
||||
}
|
||||
if (emojis == null || emojis.isEmpty()) {
|
||||
throw new TelegramApiValidationException("emojis can't be empty", this);
|
||||
|
@ -153,7 +153,7 @@ public class EditMessageMedia extends PartialBotApiMethod<Serializable> {
|
||||
}
|
||||
}
|
||||
if (media == null) {
|
||||
throw new TelegramApiValidationException("Text parameter can't be empty", this);
|
||||
throw new TelegramApiValidationException("Media parameter can't be empty", this);
|
||||
}
|
||||
|
||||
media.validate();
|
||||
|
@ -38,7 +38,7 @@ public class Chat implements BotApiObject {
|
||||
* so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
|
||||
*/
|
||||
@JsonProperty(ID_FIELD)
|
||||
private Long id; ///< Unique identifier for this chat, not exciding 1e13 by absolute value
|
||||
private Long id; ///< Unique identifier for this chat, not exceeding 1e13 by absolute value
|
||||
@JsonProperty(TYPE_FIELD)
|
||||
private String type; ///< Type of the chat, one of “private”, “group” or “channel”
|
||||
@JsonProperty(TITLE_FIELD)
|
||||
|
@ -33,7 +33,7 @@ public class ChatMember implements BotApiObject {
|
||||
@JsonProperty(STATUS_FIELD)
|
||||
private String status; ///< The member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked”
|
||||
@JsonProperty(UNTILDATE_FIELD)
|
||||
private Integer untilDate; ///< Optional. Resticted and kicked only. Date when restrictions will be lifted for this user, unix time
|
||||
private Integer untilDate; ///< Optional. Restricted and kicked only. Date when restrictions will be lifted for this user, unix time
|
||||
@JsonProperty(CANBEEDITED_FIELD)
|
||||
private Boolean canBeEdited; ///< Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user
|
||||
@JsonProperty(CANCHANGEINFORMATION_FIELD)
|
||||
@ -51,7 +51,7 @@ public class ChatMember implements BotApiObject {
|
||||
@JsonProperty(CANPINMESSAGES_FIELD)
|
||||
private Boolean canPinMessages; ///< Optional. Administrators only. True, if the administrator can pin messages
|
||||
@JsonProperty(CANPROMOTEMEMBERS_FIELD)
|
||||
private Boolean canPromoteMembers; ///< Optional. Administrators only. True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that it has promoted, directly or indirectly (promoted by administators that were appointed by the bot)
|
||||
private Boolean canPromoteMembers; ///< Optional. Administrators only. True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that it has promoted, directly or indirectly (promoted by administrators that were appointed by the bot)
|
||||
@JsonProperty(CANSENDMESSAGES_FIELD)
|
||||
private Boolean canSendMessages; ///< Optional. Restricted only. True, if the user can send text messages, contacts, locations and venues
|
||||
@JsonProperty(CANSENDMEDIAMESSAGES_FIELD)
|
||||
|
@ -27,7 +27,7 @@ public class PhotoSize implements BotApiObject {
|
||||
@JsonProperty(FILESIZE_FIELD)
|
||||
private Integer fileSize; ///< Optional. File size
|
||||
@JsonProperty(FILEPATH_FIELD)
|
||||
private String filePath; ///< Undocumented field. Optional. Can contain the path to download the file direclty without calling to getFile
|
||||
private String filePath; ///< Undocumented field. Optional. Can contain the path to download the file directly without calling to getFile
|
||||
|
||||
public PhotoSize() {
|
||||
super();
|
||||
|
@ -189,7 +189,7 @@ public class InlineQueryResultVenue implements InlineQueryResult {
|
||||
throw new TelegramApiValidationException("Longitude parameter can't be empty", this);
|
||||
}
|
||||
if (address == null || address.isEmpty()) {
|
||||
throw new TelegramApiValidationException("Longitude parameter can't be empty", this);
|
||||
throw new TelegramApiValidationException("Address parameter can't be empty", this);
|
||||
}
|
||||
if (inputMessageContent != null) {
|
||||
inputMessageContent.validate();
|
||||
|
Loading…
Reference in New Issue
Block a user