diff options
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/controllers')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java b/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java index dc10ceba..4496f6a3 100644 --- a/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java +++ b/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java @@ -24,7 +24,6 @@ import com.juick.service.UserService; import com.pengrad.telegrambot.BotUtils; import com.pengrad.telegrambot.model.Message; import com.pengrad.telegrambot.model.Update; -import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; @@ -36,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.inject.Inject; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.List; @@ -56,7 +56,7 @@ public class TelegramWebhook { @RequestMapping(value = "/tlgmbtwbhk", method = RequestMethod.POST) @ResponseStatus(value = HttpStatus.OK) public void processUpdate(InputStream body) throws IOException { - Update update = BotUtils.parseUpdate(IOUtils.toString(body, StandardCharsets.UTF_8)); + Update update = BotUtils.parseUpdate(new InputStreamReader(body, StandardCharsets.UTF_8)); Message message = update.message(); if (update.message() == null) { message = update.editedMessage(); |