Add example in java for readme

This commit is contained in:
Sambo Chea 2021-05-24 20:20:10 +07:00
parent 0f66f6e191
commit 775b8fc3a2

View File

@ -1,5 +1,30 @@
# Example Java Swing for Send Message App with Telegram # Example Java Swing for Send Message App with Telegram
- Telegram Bot Send Message - 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 # Contributors
- Sombo Chea <sombochea@cubetiqs.com> - Sombo Chea <sombochea@cubetiqs.com>