Skip to content

Commit bfbe8e2

Browse files
committed
Parse Update object from webhook message
1 parent eaa8241 commit bfbe8e2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.pengrad.telegrambot;
2+
3+
import com.google.gson.Gson;
4+
import com.pengrad.telegrambot.model.Update;
5+
6+
import java.io.Reader;
7+
8+
/**
9+
* stas
10+
* 11/1/15.
11+
*/
12+
public class BotUtils {
13+
14+
private static Gson gson = new Gson();
15+
16+
public static Update parseUpdate(String update) {
17+
return gson.fromJson(update, Update.class);
18+
}
19+
20+
public static Update parseUpdate(Reader reader) {
21+
return gson.fromJson(reader, Update.class);
22+
}
23+
24+
}

0 commit comments

Comments
 (0)