LibTgBotPP
 All Classes Namespaces Files Functions Variables Typedefs Macros
Telegram::TelegramBot Class Reference

#include <TelegramBot.h>

Public Member Functions

 TelegramBot ()
 
 TelegramBot (std::string)
 
void addCommand (TCommand)
 
void setWebhook (std::string)
 
void processMessage (std::string)
 
void sendMessage (std::string, Json::Int64)
 
void sendMessage (std::string, std::string)
 
Telegram::MessagegetMessage ()
 
std::map< std::string, TCommandgetCommandMap ()
 

Private Member Functions

void init ()
 
void apiRequest (std::string, std::map< std::string, std::string >)
 
void apiRequestJson (std::string, std::map< std::string, std::string >)
 
std::string processCommand (std::string)
 

Private Attributes

std::string api_url
 
Telegram::Messagemsg
 
TCommandMap command_map
 
Json::Int64 chat_id
 

Constructor & Destructor Documentation

Telegram::TelegramBot::TelegramBot ( )
Telegram::TelegramBot::TelegramBot ( std::string  token)

Member Function Documentation

void Telegram::TelegramBot::addCommand ( TCommand  cmd)
void Telegram::TelegramBot::apiRequest ( std::string  method,
std::map< std::string, std::string >  parameters 
)
private
void Telegram::TelegramBot::apiRequestJson ( std::string  method,
std::map< std::string, std::string >  parameters 
)
private
Telegram::TCommandMap Telegram::TelegramBot::getCommandMap ( )
Telegram::Message * Telegram::TelegramBot::getMessage ( )
void Telegram::TelegramBot::init ( void  )
private
std::string Telegram::TelegramBot::processCommand ( std::string  cmd)
private
void Telegram::TelegramBot::processMessage ( std::string  message)
void Telegram::TelegramBot::sendMessage ( std::string  message,
Json::Int64  chat_id 
)
void Telegram::TelegramBot::sendMessage ( std::string  message,
std::string  chat_id 
)
void Telegram::TelegramBot::setWebhook ( std::string  url)

Set the webhook The web hook URL is like https://<your domain>="">/cgi-bin/mybot.cgi A web hook must be set before you can get any messages from the Telegram network!

Member Data Documentation

std::string Telegram::TelegramBot::api_url
private
Json::Int64 Telegram::TelegramBot::chat_id
private
TCommandMap Telegram::TelegramBot::command_map
private
Telegram::Message* Telegram::TelegramBot::msg
private

The documentation for this class was generated from the following files: