From 5a76b2a0d7b1ae51425d68e25389f43745a2da83 Mon Sep 17 00:00:00 2001 From: J_F Date: Fri, 9 Nov 2018 17:47:00 +0100 Subject: [PATCH] change username in 'sender' to first_name' change 'sender' from 'username' to 'first_name' to receive correct sender. --- src/TelegramBot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TelegramBot.cpp b/src/TelegramBot.cpp index c00846d..b341374 100755 --- a/src/TelegramBot.cpp +++ b/src/TelegramBot.cpp @@ -47,7 +47,7 @@ message TelegramBot::getUpdates() { update_id = update_id+1; if(last_message_recived != update_id ){ - String sender = root["result"][0]["message"]["from"]["username"]; + String sender = root["result"][0]["message"]["from"]["first_name"]; String text = root["result"][0]["message"]["text"]; String chat_id = root["result"][0]["message"]["chat"]["id"]; String date = root["result"][0]["message"]["date"];