Files
QtTelegramBot/types/chat.cpp
Moritz Sternemann 3663fd38ce Initial commit
2015-12-29 16:44:16 +01:00

16 lines
469 B
C++

#include "chat.h"
using namespace Telegram;
Chat::Chat(QJsonObject chat)
{
id = chat.value("id").toInt();
QString chatType = chat.value("type").toString();
if (chatType == "private") type = Private;
else if (chatType == "group") type = Group;
else if (chatType == "channel") type = Channel;
username = chat.value("username").toString();
firstname = chat.value("first_name").toString();
lastname = chat.value("last_name").toString();
}