Added get methods to User class
This commit is contained in:
parent
14f40d257d
commit
fc91e260d2
@ -10,6 +10,11 @@ namespace Telegram {
|
||||
public:
|
||||
User(Json::Value);
|
||||
|
||||
Json::Int64 getId();
|
||||
std::string getFirstName();
|
||||
std::string getLastName();
|
||||
std::string getUserName();
|
||||
|
||||
private:
|
||||
Json::Int64 id;
|
||||
std::string first_name;
|
||||
|
24
src/User.cc
24
src/User.cc
@ -1,5 +1,8 @@
|
||||
#include "Telegram/User.h"
|
||||
|
||||
/**
|
||||
* Constructor of class User
|
||||
*/
|
||||
Telegram::User::User(Json::Value json) {
|
||||
|
||||
this->id = json["id"].asUInt64();
|
||||
@ -7,3 +10,24 @@ Telegram::User::User(Json::Value json) {
|
||||
this->last_name = json["last_name"].asString();
|
||||
this->username = json["username"].asString();
|
||||
}
|
||||
|
||||
// Getter
|
||||
Json::Int64 Telegram::User::getId() {
|
||||
|
||||
return(this->id);
|
||||
}
|
||||
|
||||
std::string Telegram::User::getFirstName() {
|
||||
|
||||
return(this->first_name);
|
||||
}
|
||||
|
||||
std::string Telegram::User::getLastName() {
|
||||
|
||||
return(this->last_name);
|
||||
}
|
||||
|
||||
std::string Telegram::User::getUserName() {
|
||||
|
||||
return(this->username);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user