qTbot
0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
Toggle main menu visibility
telegramcontact.cpp
Go to the documentation of this file.
1
//#
2
//# Copyright (C) 2023-2026 QuasarApp.
3
//# Distributed under the GPLv3 software license, see the accompanying
4
//# Everyone is permitted to copy and distribute verbatim copies
5
//# of this license document, but changing it is not allowed.
6
//#
7
#include "
telegramcontact.h
"
8
9
namespace
qTbot
{
10
11
TelegramContact::TelegramContact
()
12
{
13
14
}
15
16
TelegramContact::TelegramContact
(
const
QJsonObject &jsonObject):
IJsonBasedObject
(jsonObject) {
17
18
}
19
20
21
unsigned
long
long
TelegramContact::userIdInt
()
const
{
22
return
rawJson
()[
"user_id"
].toInteger();
23
}
24
25
QVariant
TelegramContact::userId
()
const
{
26
return
rawJson
()[
"user_id"
];
27
}
28
29
QString
TelegramContact::firstName
()
const
{
30
return
rawJson
()[
"first_name"
].toString();
31
}
32
33
QString
TelegramContact::lastName
()
const
{
34
return
rawJson
()[
"last_name"
].toString();
35
}
36
37
QString
TelegramContact::username
()
const
{
38
return
rawJson
()[
"username"
].toString();
39
}
40
41
QString
TelegramContact::phone
()
const
{
42
return
rawJson
()[
"phone_number"
].toString();
43
}
44
45
QString
TelegramContact::languageCode
()
const
{
46
return
rawJson
()[
"language_code"
].toString();
47
}
48
}
qTbot::IJsonBasedObject::rawJson
const QJsonObject & rawJson() const
rawJson Telegram uses a rest api with json objects. So all received messages are parsed into a json o...
Definition
ijsonbasedobject.cpp:21
qTbot::IJsonBasedObject::IJsonBasedObject
IJsonBasedObject()
IJsonBasedObject default constructor.
Definition
ijsonbasedobject.cpp:12
qTbot::TelegramContact::phone
QString phone() const
phone Returns the phone number of the contact.
Definition
telegramcontact.cpp:41
qTbot::TelegramContact::lastName
QString lastName() const
lastName Returns the last name of the contact.
Definition
telegramcontact.cpp:33
qTbot::TelegramContact::firstName
QString firstName() const
firstName Returns the first name of the contact.
Definition
telegramcontact.cpp:29
qTbot::TelegramContact::TelegramContact
TelegramContact()
TelegramContact default constructor.
Definition
telegramcontact.cpp:11
qTbot::TelegramContact::username
QString username() const
username Returns the username of the contact.
Definition
telegramcontact.cpp:37
qTbot::TelegramContact::languageCode
QString languageCode() const
languageCode Returns the language code of the contact.
Definition
telegramcontact.cpp:45
qTbot::TelegramContact::userId
QVariant userId() const
userId This is the id of the user contact.
Definition
telegramcontact.cpp:25
qTbot::TelegramContact::userIdInt
unsigned long long userIdInt() const
userIdInt This is the numeric id of the user contact.
Definition
telegramcontact.cpp:21
qTbot
Definition
telegramdeletemessage.cpp:8
telegramcontact.h
src
qTbot
src
public
qTbot
messages
telegramcontact.cpp
Generated by
1.18.0