diff options
author | fadhil riyanto <me@fadev.org> | 2024-08-11 11:54:56 +0700 |
---|---|---|
committer | fadhil riyanto <me@fadev.org> | 2024-08-11 11:54:56 +0700 |
commit | 8934423853b65d2376e3cbc2bded2adca0b0a0d2 (patch) | |
tree | 9dc4d059595ecaaa4bec3efaed97958e48fbd32f /README.md | |
parent | 47f5f69f1df08d030e57f81f87024146372a2ce0 (diff) |
update readme
Signed-off-by: fadhil riyanto <me@fadev.org>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -25,7 +25,14 @@ Simple echo bot which sends everything it receives: #include <tgbot/tgbot.h> int main() { - TgBot::Bot bot("PLACE YOUR TOKEN HERE"); + TgBot::CurlHttpClient curlHttpClient; + + TgBot::Bot bot( + "PLACE YOUR TOKEN HERE", + "https://api.telegram.org", + curlHttpClient + ); + bot.getEvents().onCommand("start", [&bot](TgBot::Message::Ptr message) { bot.getApi().sendMessage(message->chat->id, "Hi!"); }); |