-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from rubenlagus/dev
Update BOT API 2.3.1
- Loading branch information
Showing
17 changed files
with
221 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...bots-meta/src/main/java/org/telegram/telegrambots/api/methods/updates/AllowedUpdates.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.telegram.telegrambots.api.methods.updates; | ||
|
||
/** | ||
* @author Ruben Bermudez | ||
* @version 1.0 | ||
*/ | ||
public final class AllowedUpdates { | ||
public static final String MESSAGE = "message"; | ||
public static final String EDITEDMESSAGE = "edited_message"; | ||
public static final String CHANNELPOST = "channel_post"; | ||
public static final String EDITEDCHANNELPOST = "edited_channel_post"; | ||
public static final String INLINEQUERY = "inline_query"; | ||
public static final String CHOSENINLINERESULT = "chosen_inline_result"; | ||
public static final String CALLBACKQUERY = "callback_query"; | ||
} |
55 changes: 55 additions & 0 deletions
55
...mbots-meta/src/main/java/org/telegram/telegrambots/api/methods/updates/DeleteWebhook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.telegram.telegrambots.api.methods.updates; | ||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
|
||
import org.telegram.telegrambots.api.methods.BotApiMethod; | ||
import org.telegram.telegrambots.api.objects.replykeyboard.ApiResponse; | ||
import org.telegram.telegrambots.exceptions.TelegramApiRequestException; | ||
import org.telegram.telegrambots.exceptions.TelegramApiValidationException; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* @author Ruben Bermudez | ||
* @version 1.0 | ||
* @brief Use this method to receive incoming updates using long polling (wiki). An Array of Update | ||
* objects is returned. | ||
* @date 20 of June of 2015 | ||
*/ | ||
public class DeleteWebhook extends BotApiMethod<Boolean>{ | ||
public static final String PATH = "deleteWebhook"; | ||
|
||
public DeleteWebhook() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public String getMethod() { | ||
return PATH; | ||
} | ||
|
||
@Override | ||
public Boolean deserializeResponse(String answer) throws | ||
TelegramApiRequestException { | ||
try { | ||
ApiResponse<Boolean> result = OBJECT_MAPPER.readValue(answer, | ||
new TypeReference<ApiResponse<Boolean>>(){}); | ||
if (result.getOk()) { | ||
return result.getResult(); | ||
} else { | ||
throw new TelegramApiRequestException("Error deleting webhook", result); | ||
} | ||
} catch (IOException e) { | ||
throw new TelegramApiRequestException("Unable to deserialize response", e); | ||
} | ||
} | ||
|
||
@Override | ||
public void validate() throws TelegramApiValidationException { | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "DeleteWebhook{}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.