xxtelebot  1.4.1.0
A simple Telegram Bot implementation in C++
Public Types | Public Member Functions | Protected Types | Protected Attributes | List of all members
tgbot::RegisterCallback Class Reference

registers and holds callbacks for each type of update More...

#include <register_callback.h>

Inheritance diagram for tgbot::RegisterCallback:
tgbot::Bot tgbot::LongPollBot tgbot::WebhookBot

Public Types

using MessageCallback = __T_UpdateCallback< types::Message >
 
using InlineQueryCallback = __T_UpdateCallback< types::InlineQuery >
 
using ChosenInlineResultCallback = __T_UpdateCallback< types::ChosenInlineResult >
 
using CallbackQueryCallback = __T_UpdateCallback< types::CallbackQuery >
 
using ShippingQueryCallback = __T_UpdateCallback< types::ShippingQuery >
 
using PreCheckoutQueryCallback = __T_UpdateCallback< types::PreCheckoutQuery >
 

Public Member Functions

void callback (bool(&matcherCallback)(const std::string &, const char *), void(&callback)(const types::Message, const methods::Api &, const std::vector< std::string >), const char *matchWord, const char sep= ' ')
 C-style function pointer callback overload, associate with command. More...
 
void callback (bool(&matcherCallback)(const std::string &, const char *), std::function< void(const types::Message, const methods::Api &, const std::vector< std::string >)> callback, const char *matchWord, const char sep= ' ')
 std::function wrapper callback overload, associate with command (ability to use lambdas More...
 
void callback (std::function< bool(const std::string &, const char *)> matcherCallback, void(&callback)(const types::Message, const methods::Api &, const std::vector< std::string >), const char *matchWord, const char sep= ' ')
 C-style function pointer callback overload, associate with command. More...
 
void callback (std::function< bool(const std::string &, const char *)> matcherCallback, std::function< void(const types::Message, const methods::Api &, const std::vector< std::string >)> callback, const char *matchWord, const char sep= ' ')
 std::function wrapper callback overload, associate with command (ability to use lambdas More...
 
void callback (void(&callback)(const types::Message, const methods::Api &))
 Message update callback. More...
 
void callback (MessageCallback callback)
 Message update callback. More...
 
void callback (void(&callback)(const types::InlineQuery, const methods::Api &))
 Inline query update callback. More...
 
void callback (InlineQueryCallback callback)
 Inline query update callback. More...
 
void callback (void(&callback)(const types::ChosenInlineResult, const methods::Api &))
 Chosen inline result update callback. More...
 
void callback (ChosenInlineResultCallback callback)
 
void callback (void(&callback)(const types::CallbackQuery, const methods::Api &))
 Callback query update callback. More...
 
void callback (CallbackQueryCallback callback)
 Callback query update callback. More...
 
void callback (void(&callback)(const types::ShippingQuery, const methods::Api &))
 Shipping query update callback. More...
 
void callback (ShippingQueryCallback callback)
 Shipping query update callback. More...
 
void callback (void(&callback)(const types::PreCheckoutQuery, const methods::Api &))
 Pre checkout query update callback. More...
 
void callback (PreCheckoutQueryCallback callback)
 Pre checkout query update callback. More...
 
void callback (void(&callback)(const types::Message, const methods::Api &), const types::UpdateType &which)
 Multiple-options update callback. More...
 
void callback (MessageCallback callback, const types::UpdateType updateType)
 Multiple-options update callback. More...
 

Protected Types

using __Command_Tuple = std::tuple< const char *, std::function< bool(const std::string &, const char *)>, const char, std::function< void(const types::Message, const methods::Api &, const std::vector< std::string >)> >
 

Protected Attributes

MessageCallback messageCallback
 
InlineQueryCallback inlineQueryCallback
 
ChosenInlineResultCallback chosenInlineResultCallback
 
CallbackQueryCallback callbackQueryCallback
 
ShippingQueryCallback shippingQueryCallback
 
PreCheckoutQueryCallback preCheckoutQueryCallback
 
MessageCallback editedMessageCallback
 
MessageCallback editedChannelPostCallback
 
MessageCallback channelPostCallback
 
std::vector< __Command_Tuple > commandCallback
 

Detailed Description

registers and holds callbacks for each type of update

Member Function Documentation

void tgbot::RegisterCallback::callback ( bool(&)(const std::string &, const char *)  matcherCallback,
void(&)(const types::Message, const methods::Api &, const std::vector< std::string >)  callback,
const char *  matchWord,
const char  sep = ' ' 
)
inline

C-style function pointer callback overload, associate with command.

Parameters
matcherCallback,thefunction responsible for giving result about the matching (see whenStarts() and whenContains())
callback,functionthat gets called when string matches with given instructions
matchWord,commandstring (e.g. /say hello : matchWord = "/say ")
sep,separator.(space character by default)
void tgbot::RegisterCallback::callback ( bool(&)(const std::string &, const char *)  matcherCallback,
std::function< void(const types::Message, const methods::Api &, const std::vector< std::string >)>  callback,
const char *  matchWord,
const char  sep = ' ' 
)
inline

std::function wrapper callback overload, associate with command (ability to use lambdas

Parameters
matcherCallback,thefunction responsible for giving result about the matching (see whenStarts() and whenContains())
callback,functionthat gets called when string matches with given instructions
matchWord,commandstring (e.g. /say hello : matchWord = "/say ")
sep,separator.(space character by default)
void tgbot::RegisterCallback::callback ( std::function< bool(const std::string &, const char *)>  matcherCallback,
void(&)(const types::Message, const methods::Api &, const std::vector< std::string >)  callback,
const char *  matchWord,
const char  sep = ' ' 
)
inline

C-style function pointer callback overload, associate with command.

Parameters
matcherCallback,thefunction responsible for giving result about the matching (see whenStarts() and whenContains())
callback,functionthat gets called when string matches with given instructions
matchWord,commandstring (e.g. /say hello : matchWord = "/say ")
sep,separator.(space character by default)
void tgbot::RegisterCallback::callback ( std::function< bool(const std::string &, const char *)>  matcherCallback,
std::function< void(const types::Message, const methods::Api &, const std::vector< std::string >)>  callback,
const char *  matchWord,
const char  sep = ' ' 
)
inline

std::function wrapper callback overload, associate with command (ability to use lambdas

Parameters
matcherCallback,thefunction responsible for giving result about the matching (see whenStarts() and whenContains())
callback,functionthat gets called when string matches with given instructions
matchWord,commandstring (e.g. /say hello : matchWord = "/say ")
sep,separator.(space character by default)
void tgbot::RegisterCallback::callback ( void(&)(const types::Message, const methods::Api &)  callback)
inline

Message update callback.

Parameters
callback
void tgbot::RegisterCallback::callback ( MessageCallback  callback)
inline

Message update callback.

Parameters
callback
void tgbot::RegisterCallback::callback ( void(&)(const types::InlineQuery, const methods::Api &)  callback)
inline

Inline query update callback.

Parameters
callback
void tgbot::RegisterCallback::callback ( InlineQueryCallback  callback)
inline

Inline query update callback.

Parameters
callback
void tgbot::RegisterCallback::callback ( void(&)(const types::ChosenInlineResult, const methods::Api &)  callback)
inline

Chosen inline result update callback.

Parameters
callback
void tgbot::RegisterCallback::callback ( ChosenInlineResultCallback  callback)
inline

Chosen inline result update callback

Parameters
callback
void tgbot::RegisterCallback::callback ( void(&)(const types::CallbackQuery, const methods::Api &)  callback)
inline

Callback query update callback.

Parameters
callback
void tgbot::RegisterCallback::callback ( CallbackQueryCallback  callback)
inline

Callback query update callback.

Parameters
callback
void tgbot::RegisterCallback::callback ( void(&)(const types::ShippingQuery, const methods::Api &)  callback)
inline

Shipping query update callback.

Parameters
callback
void tgbot::RegisterCallback::callback ( ShippingQueryCallback  callback)
inline

Shipping query update callback.

Parameters
callback
void tgbot::RegisterCallback::callback ( void(&)(const types::PreCheckoutQuery, const methods::Api &)  callback)
inline

Pre checkout query update callback.

Parameters
callback
void tgbot::RegisterCallback::callback ( PreCheckoutQueryCallback  callback)
inline

Pre checkout query update callback.

Parameters
callback
void tgbot::RegisterCallback::callback ( void(&)(const types::Message, const methods::Api &)  callback,
const types::UpdateType &  which 
)
inline

Multiple-options update callback.

Parameters
callback
which: accepted values: EDITED_MESSAGE, EDITED_CHANNEL_POST, CHANNEL_POST. Others ignored
void tgbot::RegisterCallback::callback ( MessageCallback  callback,
const types::UpdateType  updateType 
)
inline

Multiple-options update callback.

Parameters
callback
which: accepted values: EDITED_MESSAGE, EDITED_CHANNEL_POST, CHANNEL_POST. Others ignored

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