AsyncTelegram2
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | List of all members
AsyncTelegram2 Class Reference

#include <AsyncTelegram2.h>

Public Types

enum  DocumentType {
  ZIP , PDF , PHOTO , ANIMATION ,
  AUDIO , VOICE , VIDEO , CSV ,
  JSON
}
 
enum  FormatStyle { NONE , HTML , MARKDOWN }
 

Public Member Functions

 AsyncTelegram2 (Client &client, uint32_t bufferSize=BUFFER_BIG)
 
 ~AsyncTelegram2 ()
 
bool begin (void)
 
bool reset (void)
 
void setTelegramToken (const char *token)
 
void setUpdateTime (uint32_t pollingTime)
 
bool getFile (TBDocument &doc)
 
MessageType getNewMessage (TBMessage &message)
 
bool sendMessage (const TBMessage &msg, const char *message, const char *keyboard=nullptr, bool wait=false)
 
bool sendMessage (const TBMessage &msg, const String &message, String keyboard="")
 
bool sendMessage (const TBMessage &msg, const char *message, InlineKeyboard &keyboard)
 
bool sendMessage (const TBMessage &msg, const char *message, ReplyKeyboard &keyboard)
 
bool forwardMessage (const TBMessage &msg, const int64_t to_chatid)
 
bool sendToChannel (const char *channel, const char *message, bool silent=false)
 
bool sendToChannel (const String &channel, const String &message, bool silent)
 
bool sendTo (const int64_t userid, const char *message, const char *keyboard=nullptr)
 
bool sendTo (const int64_t userid, const String &message, String keyboard="")
 
bool sendDocument (int64_t chat_id, Stream &stream, size_t size, DocumentType doc, const char *filename, const char *caption=nullptr)
 
bool sendDocument (const TBMessage &msg, Stream &stream, size_t size, DocumentType doc, const char *filename, const char *caption=nullptr)
 
bool sendPhotoByUrl (const int64_t &chat_id, const char *url, const char *caption)
 
bool sendAnimationByUrl (const int64_t &chat_id, const char *url, const char *caption)
 
bool sendPhoto (const int64_t &chat_id, const char *url, const char *caption)
 
bool sendPhoto (const int64_t &chat_id, const String &url, const String &caption)
 
bool sendPhoto (const TBMessage &msg, const String &url, const String &caption)
 
bool sendPhoto (int64_t chat_id, Stream &stream, size_t size, const char *filename=nullptr, const char *caption=nullptr)
 
bool sendPhoto (const TBMessage &msg, Stream &stream, size_t size, const char *filename, const char *caption=nullptr)
 
bool sendPhoto (int64_t chat_id, uint8_t *data, size_t size, const char *caption=nullptr)
 
bool sendPhoto (const TBMessage &msg, uint8_t *data, size_t size, const char *caption=nullptr)
 
bool sendPhotoByUrl (const int64_t &chat_id, const String &url, const String &caption)
 
bool sendPhotoByUrl (const TBMessage &msg, const String &url, const String &caption)
 
bool sendPhotoByFile (int64_t chat_id, Stream *stream, size_t size)
 
bool endQuery (const TBMessage &msg, const char *message, bool alertMode=false)
 
bool removeReplyKeyboard (const TBMessage &msg, const char *message, bool selective=false)
 
const char * getBotName ()
 
bool noNewMessage ()
 
int64_t getGroupId (const TBMessage &msg)
 
void addInlineKeyboard (InlineKeyboard *keyb)
 
bool setMyCommands (const String &cmd, const String &desc)
 
void getMyCommands (String &cmdList)
 
bool deleteMyCommands ()
 
bool editMessage (int32_t chat_id, int32_t message_id, const String &txt, const String &keyboard)
 
bool editMessage (const TBMessage &msg, const String &txt, const String &keyboard)
 
bool editMessage (int32_t chat_id, int32_t message_id, const String &txt, InlineKeyboard &keyboard)
 
bool editMessage (const TBMessage &msg, const String &txt, InlineKeyboard &keyboard)
 
bool checkConnection ()
 
void addSentCallback (SentCallback sentcb, uint32_t timeout=1000)
 
void setFormattingStyle (uint8_t format)
 
void setJsonBufferSize (uint32_t jsonBufferSize)
 

Protected Member Functions

bool sendCommand (const char *command, const char *payload, bool blocking=false)
 
bool getUpdates ()
 
bool getMe ()
 

Detailed Description

Definition at line 93 of file AsyncTelegram2.h.

Member Enumeration Documentation

◆ DocumentType

Enumerator
ZIP 
PDF 
PHOTO 
ANIMATION 
AUDIO 
VOICE 
VIDEO 
CSV 
JSON 

Definition at line 196 of file AsyncTelegram2.h.

◆ FormatStyle

Enumerator
NONE 
HTML 
MARKDOWN 

Definition at line 424 of file AsyncTelegram2.h.

Constructor & Destructor Documentation

◆ AsyncTelegram2()

AsyncTelegram2::AsyncTelegram2 ( Client &  client,
uint32_t  bufferSize = BUFFER_BIG 
)

Definition at line 5 of file AsyncTelegram2.cpp.

◆ ~AsyncTelegram2()

AsyncTelegram2::~AsyncTelegram2 ( )

Definition at line 13 of file AsyncTelegram2.cpp.

Member Function Documentation

◆ addInlineKeyboard()

void AsyncTelegram2::addInlineKeyboard ( InlineKeyboard keyb)
inline

Definition at line 356 of file AsyncTelegram2.h.

◆ addSentCallback()

void AsyncTelegram2::addSentCallback ( SentCallback  sentcb,
uint32_t  timeout = 1000 
)
inline

Definition at line 410 of file AsyncTelegram2.h.

◆ begin()

bool AsyncTelegram2::begin ( void  )

Definition at line 52 of file AsyncTelegram2.cpp.

◆ checkConnection()

bool AsyncTelegram2::checkConnection ( )

Definition at line 15 of file AsyncTelegram2.cpp.

◆ deleteMyCommands()

bool AsyncTelegram2::deleteMyCommands ( )

Definition at line 786 of file AsyncTelegram2.cpp.

◆ editMessage() [1/4]

bool AsyncTelegram2::editMessage ( const TBMessage msg,
const String &  txt,
const String &  keyboard 
)
inline

Definition at line 389 of file AsyncTelegram2.h.

◆ editMessage() [2/4]

bool AsyncTelegram2::editMessage ( const TBMessage msg,
const String &  txt,
InlineKeyboard keyboard 
)
inline

Definition at line 399 of file AsyncTelegram2.h.

◆ editMessage() [3/4]

bool AsyncTelegram2::editMessage ( int32_t  chat_id,
int32_t  message_id,
const String &  txt,
const String &  keyboard 
)

Definition at line 838 of file AsyncTelegram2.cpp.

◆ editMessage() [4/4]

bool AsyncTelegram2::editMessage ( int32_t  chat_id,
int32_t  message_id,
const String &  txt,
InlineKeyboard keyboard 
)
inline

Definition at line 394 of file AsyncTelegram2.h.

◆ endQuery()

bool AsyncTelegram2::endQuery ( const TBMessage msg,
const char *  message,
bool  alertMode = false 
)

Definition at line 585 of file AsyncTelegram2.cpp.

◆ forwardMessage()

bool AsyncTelegram2::forwardMessage ( const TBMessage msg,
const int64_t  to_chatid 
)

Definition at line 509 of file AsyncTelegram2.cpp.

◆ getBotName()

const char * AsyncTelegram2::getBotName ( )
inline

Definition at line 332 of file AsyncTelegram2.h.

◆ getFile()

bool AsyncTelegram2::getFile ( TBDocument doc)

Definition at line 406 of file AsyncTelegram2.cpp.

◆ getGroupId()

int64_t AsyncTelegram2::getGroupId ( const TBMessage msg)
inline

Definition at line 347 of file AsyncTelegram2.h.

◆ getMe()

bool AsyncTelegram2::getMe ( )
protected

Definition at line 391 of file AsyncTelegram2.cpp.

◆ getMyCommands()

void AsyncTelegram2::getMyCommands ( String &  cmdList)

Definition at line 768 of file AsyncTelegram2.cpp.

◆ getNewMessage()

MessageType AsyncTelegram2::getNewMessage ( TBMessage message)

Definition at line 209 of file AsyncTelegram2.cpp.

◆ getUpdates()

bool AsyncTelegram2::getUpdates ( )
protected

Definition at line 119 of file AsyncTelegram2.cpp.

◆ noNewMessage()

bool AsyncTelegram2::noNewMessage ( )

Definition at line 428 of file AsyncTelegram2.cpp.

◆ removeReplyKeyboard()

bool AsyncTelegram2::removeReplyKeyboard ( const TBMessage msg,
const char *  message,
bool  selective = false 
)

Definition at line 597 of file AsyncTelegram2.cpp.

◆ reset()

bool AsyncTelegram2::reset ( void  )

Definition at line 58 of file AsyncTelegram2.cpp.

◆ sendAnimationByUrl()

bool AsyncTelegram2::sendAnimationByUrl ( const int64_t &  chat_id,
const char *  url,
const char *  caption 
)

Definition at line 537 of file AsyncTelegram2.cpp.

◆ sendCommand()

bool AsyncTelegram2::sendCommand ( const char *  command,
const char *  payload,
bool  blocking = false 
)
protected

Definition at line 71 of file AsyncTelegram2.cpp.

◆ sendDocument() [1/2]

bool AsyncTelegram2::sendDocument ( const TBMessage msg,
Stream &  stream,
size_t  size,
DocumentType  doc,
const char *  filename,
const char *  caption = nullptr 
)
inline

Definition at line 211 of file AsyncTelegram2.h.

◆ sendDocument() [2/2]

bool AsyncTelegram2::sendDocument ( int64_t  chat_id,
Stream &  stream,
size_t  size,
DocumentType  doc,
const char *  filename,
const char *  caption = nullptr 
)

Definition at line 607 of file AsyncTelegram2.cpp.

◆ sendMessage() [1/4]

bool AsyncTelegram2::sendMessage ( const TBMessage msg,
const char *  message,
const char *  keyboard = nullptr,
bool  wait = false 
)

Definition at line 444 of file AsyncTelegram2.cpp.

◆ sendMessage() [2/4]

bool AsyncTelegram2::sendMessage ( const TBMessage msg,
const char *  message,
InlineKeyboard keyboard 
)
inline

Definition at line 159 of file AsyncTelegram2.h.

◆ sendMessage() [3/4]

bool AsyncTelegram2::sendMessage ( const TBMessage msg,
const char *  message,
ReplyKeyboard keyboard 
)
inline

Definition at line 164 of file AsyncTelegram2.h.

◆ sendMessage() [4/4]

bool AsyncTelegram2::sendMessage ( const TBMessage msg,
const String &  message,
String  keyboard = "" 
)
inline

Definition at line 154 of file AsyncTelegram2.h.

◆ sendPhoto() [1/7]

bool AsyncTelegram2::sendPhoto ( const int64_t &  chat_id,
const char *  url,
const char *  caption 
)
inline

Definition at line 223 of file AsyncTelegram2.h.

◆ sendPhoto() [2/7]

bool AsyncTelegram2::sendPhoto ( const int64_t &  chat_id,
const String &  url,
const String &  caption 
)
inline

Definition at line 228 of file AsyncTelegram2.h.

◆ sendPhoto() [3/7]

bool AsyncTelegram2::sendPhoto ( const TBMessage msg,
const String &  url,
const String &  caption 
)
inline

Definition at line 233 of file AsyncTelegram2.h.

◆ sendPhoto() [4/7]

bool AsyncTelegram2::sendPhoto ( const TBMessage msg,
Stream &  stream,
size_t  size,
const char *  filename,
const char *  caption = nullptr 
)
inline

Definition at line 244 of file AsyncTelegram2.h.

◆ sendPhoto() [5/7]

bool AsyncTelegram2::sendPhoto ( const TBMessage msg,
uint8_t *  data,
size_t  size,
const char *  caption = nullptr 
)
inline

Definition at line 273 of file AsyncTelegram2.h.

◆ sendPhoto() [6/7]

bool AsyncTelegram2::sendPhoto ( int64_t  chat_id,
Stream &  stream,
size_t  size,
const char *  filename = nullptr,
const char *  caption = nullptr 
)
inline

Definition at line 239 of file AsyncTelegram2.h.

◆ sendPhoto() [7/7]

bool AsyncTelegram2::sendPhoto ( int64_t  chat_id,
uint8_t *  data,
size_t  size,
const char *  caption = nullptr 
)
inline

Definition at line 268 of file AsyncTelegram2.h.

◆ sendPhotoByFile()

bool AsyncTelegram2::sendPhotoByFile ( int64_t  chat_id,
Stream *  stream,
size_t  size 
)
inline

Definition at line 290 of file AsyncTelegram2.h.

◆ sendPhotoByUrl() [1/3]

bool AsyncTelegram2::sendPhotoByUrl ( const int64_t &  chat_id,
const char *  url,
const char *  caption 
)

Definition at line 522 of file AsyncTelegram2.cpp.

◆ sendPhotoByUrl() [2/3]

bool AsyncTelegram2::sendPhotoByUrl ( const int64_t &  chat_id,
const String &  url,
const String &  caption 
)
inline

Definition at line 280 of file AsyncTelegram2.h.

◆ sendPhotoByUrl() [3/3]

bool AsyncTelegram2::sendPhotoByUrl ( const TBMessage msg,
const String &  url,
const String &  caption 
)
inline

Definition at line 285 of file AsyncTelegram2.h.

◆ sendTo() [1/2]

bool AsyncTelegram2::sendTo ( const int64_t  userid,
const char *  message,
const char *  keyboard = nullptr 
)
inline

Definition at line 183 of file AsyncTelegram2.h.

◆ sendTo() [2/2]

bool AsyncTelegram2::sendTo ( const int64_t  userid,
const String &  message,
String  keyboard = "" 
)
inline

Definition at line 190 of file AsyncTelegram2.h.

◆ sendToChannel() [1/2]

bool AsyncTelegram2::sendToChannel ( const char *  channel,
const char *  message,
bool  silent = false 
)

Definition at line 552 of file AsyncTelegram2.cpp.

◆ sendToChannel() [2/2]

bool AsyncTelegram2::sendToChannel ( const String &  channel,
const String &  message,
bool  silent 
)
inline

Definition at line 175 of file AsyncTelegram2.h.

◆ setFormattingStyle()

void AsyncTelegram2::setFormattingStyle ( uint8_t  format)
inline

Definition at line 429 of file AsyncTelegram2.h.

◆ setJsonBufferSize()

void AsyncTelegram2::setJsonBufferSize ( uint32_t  jsonBufferSize)
inline

Definition at line 433 of file AsyncTelegram2.h.

◆ setMyCommands()

bool AsyncTelegram2::setMyCommands ( const String &  cmd,
const String &  desc 
)

Definition at line 796 of file AsyncTelegram2.cpp.

◆ setTelegramToken()

void AsyncTelegram2::setTelegramToken ( const char *  token)
inline

Definition at line 118 of file AsyncTelegram2.h.

◆ setUpdateTime()

void AsyncTelegram2::setUpdateTime ( uint32_t  pollingTime)
inline

Definition at line 124 of file AsyncTelegram2.h.


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