Add example in java for readme
This commit is contained in:
parent
0f66f6e191
commit
775b8fc3a2
25
README.md
25
README.md
@ -1,5 +1,30 @@
|
||||
# Example Java Swing for Send Message App with Telegram
|
||||
- Telegram Bot Send Message
|
||||
|
||||
# Example
|
||||
|
||||
- Send Message to Telegram Channel/Group via Bot
|
||||
```java
|
||||
String chatId = "TELEGRAM_CHAT_ID";
|
||||
String token = "TELEGRAM_BOT_TOKEN";
|
||||
String text = "Your message here";
|
||||
|
||||
TelegramBotUtils.sendMessage(
|
||||
chatId,
|
||||
text,
|
||||
token,
|
||||
null
|
||||
);
|
||||
|
||||
// OR use provider
|
||||
|
||||
TelegramProvider
|
||||
.init(token)
|
||||
.sendToChatId(chatId)
|
||||
.setMessage(text)
|
||||
.send();
|
||||
|
||||
```
|
||||
|
||||
# Contributors
|
||||
- Sombo Chea <sombochea@cubetiqs.com>
|
Loading…
Reference in New Issue
Block a user