diff --git a/include/Telegram/TelegramBot.h b/include/Telegram/TelegramBot.h index ca90464..be1c98a 100644 --- a/include/Telegram/TelegramBot.h +++ b/include/Telegram/TelegramBot.h @@ -38,6 +38,9 @@ namespace Telegram { void addCommand(TCommand); void setWebhook(std::string); void processMessage(std::string); + + Telegram::User* getMe(void); + Telegram::Message* sendMessage(std::string, Json::Int64); Telegram::Message* sendMessage(std::string, std::string); diff --git a/src/TelegramBot.cc b/src/TelegramBot.cc index eb5d97c..16e1f89 100644 --- a/src/TelegramBot.cc +++ b/src/TelegramBot.cc @@ -84,6 +84,16 @@ void Telegram::TelegramBot::processMessage(std::string message) { } } +Telegram::User *Telegram::TelegramBot::getMe(void) { + + Json::Value obj; + std::map params; + + obj = this->apiRequestJson("getMe", params); + + return(new Telegram::User(obj["result"])); +} + /** * Send a text message to a user */