yatbcpp  0.0.1
Yet another Telegram Bot CPP Library
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes | List of all members
yatbcpp::answerInlineQuery Class Reference

#include "answerInlineQuery.h"

Inheritance diagram for yatbcpp::answerInlineQuery:
Inheritance graph
[legend]
Collaboration diagram for yatbcpp::answerInlineQuery:
Collaboration graph
[legend]

Public Member Functions

 answerInlineQuery (std::string inline_query_id, std::vector< std::shared_ptr< InlineQueryResult >> results)
 
 answerInlineQuery (std::string inline_query_id)
 
Json::Value toJson ()
 
void addInlineQueryResult (std::shared_ptr< InlineQueryResult > IQR)
 
void setCache_time (const std::optional< std::int32_t > &cache_time)
 
void setIs_personal (const std::optional< bool > &is_personal)
 
void setNext_offset (const std::optional< std::string > &next_offset)
 
void setSwitch_pm_text (const std::optional< std::string > &switch_pm_text)
 
void setSwitch_pm_parameter (const std::optional< std::string > &switch_pm_parameter)
 
const std::string & getInline_query_id () const
 
const std::optional< int > & getCache_time () const
 
const std::optional< bool > & getIs_personal () const
 
const std::optional< std::string > & getNext_offset () const
 
const std::optional< std::string > & getSwitch_pm_text () const
 
const std::optional< std::string > & getSwitch_pm_parameter () const
 
const std::string & getFunctionname () const
 

Static Public Member Functions

static size_t WriteCallback (void *contents, size_t size, size_t nmemb, void *stringptr)
 
static bool perform_simplerequestJSON (Token T, telegram_simplemethodJSON &method_body)
 

Protected Attributes

std::string functionname
 

Private Attributes

std::string inline_query_id
 
std::vector< std::shared_ptr< InlineQueryResult > > results
 
std::optional< std::int32_t > cache_time
 
std::optional< bool > is_personal
 
std::optional< std::string > next_offset
 
std::optional< std::string > switch_pm_text
 
std::optional< std::string > switch_pm_parameter
 

Detailed Description

Definition at line 12 of file answerInlineQuery.h.

Constructor & Destructor Documentation

◆ answerInlineQuery() [1/2]

yatbcpp::answerInlineQuery::answerInlineQuery ( std::string  inline_query_id,
std::vector< std::shared_ptr< InlineQueryResult >>  results 
)

◆ answerInlineQuery() [2/2]

yatbcpp::answerInlineQuery::answerInlineQuery ( std::string  inline_query_id)

Member Function Documentation

◆ addInlineQueryResult()

void answerInlineQuery::addInlineQueryResult ( std::shared_ptr< InlineQueryResult IQR)

Adds an Inline Query Result to the Results, however only 50 can be handled? todo maybe separate or add page support?, todo maybe add pass by reference instead of by ptr? current state is a smart ptr

Parameters
IQR

Definition at line 56 of file answerInlineQuery.cc.

◆ getCache_time()

const optional< std::int32_t > & answerInlineQuery::getCache_time ( ) const

Definition at line 90 of file answerInlineQuery.cc.

◆ getFunctionname()

const std::string& yatbcpp::telegram_simplemethodJSON::getFunctionname ( ) const
inlineinherited

returns the Functionname

Returns

Definition at line 79 of file telegram_simplemethodJSON.h.

◆ getInline_query_id()

const string & answerInlineQuery::getInline_query_id ( ) const

Definition at line 84 of file answerInlineQuery.cc.

◆ getIs_personal()

const optional< bool > & answerInlineQuery::getIs_personal ( ) const

Definition at line 94 of file answerInlineQuery.cc.

◆ getNext_offset()

const optional< string > & answerInlineQuery::getNext_offset ( ) const

Definition at line 98 of file answerInlineQuery.cc.

◆ getSwitch_pm_parameter()

const optional< string > & answerInlineQuery::getSwitch_pm_parameter ( ) const

Definition at line 106 of file answerInlineQuery.cc.

◆ getSwitch_pm_text()

const optional< string > & answerInlineQuery::getSwitch_pm_text ( ) const

Definition at line 102 of file answerInlineQuery.cc.

◆ perform_simplerequestJSON()

static bool yatbcpp::telegram_simplemethodJSON::perform_simplerequestJSON ( Token  T,
telegram_simplemethodJSON method_body 
)
inlinestaticinherited

Function for Telegram Api which only returns a boolean value

Parameters
T
method_body
Returns

Definition at line 37 of file telegram_simplemethodJSON.h.

Here is the call graph for this function:

◆ setCache_time()

void answerInlineQuery::setCache_time ( const std::optional< std::int32_t > &  cache_time)

Definition at line 60 of file answerInlineQuery.cc.

◆ setIs_personal()

void answerInlineQuery::setIs_personal ( const std::optional< bool > &  is_personal)

Definition at line 64 of file answerInlineQuery.cc.

◆ setNext_offset()

void answerInlineQuery::setNext_offset ( const std::optional< std::string > &  next_offset)

Definition at line 68 of file answerInlineQuery.cc.

◆ setSwitch_pm_parameter()

void answerInlineQuery::setSwitch_pm_parameter ( const std::optional< std::string > &  switch_pm_parameter)

Definition at line 76 of file answerInlineQuery.cc.

◆ setSwitch_pm_text()

void answerInlineQuery::setSwitch_pm_text ( const std::optional< std::string > &  switch_pm_text)

Definition at line 72 of file answerInlineQuery.cc.

◆ toJson()

Json::Value answerInlineQuery::toJson ( )
virtual

Method Required for derived classes so they can be made into json object

Returns

Reimplemented from yatbcpp::telegram_simplemethodJSON.

Definition at line 21 of file answerInlineQuery.cc.

Here is the call graph for this function:

◆ WriteCallback()

static size_t yatbcpp::telegram_simplemethodJSON::WriteCallback ( void *  contents,
size_t  size,
size_t  nmemb,
void *  stringptr 
)
inlinestaticinherited

Definition at line 25 of file telegram_simplemethodJSON.h.

Member Data Documentation

◆ cache_time

std::optional<std::int32_t> yatbcpp::answerInlineQuery::cache_time
private

Definition at line 45 of file answerInlineQuery.h.

◆ functionname

std::string yatbcpp::telegram_simplemethodJSON::functionname
protectedinherited

Definition at line 84 of file telegram_simplemethodJSON.h.

◆ inline_query_id

std::string yatbcpp::answerInlineQuery::inline_query_id
private

Definition at line 43 of file answerInlineQuery.h.

◆ is_personal

std::optional<bool> yatbcpp::answerInlineQuery::is_personal
private

Definition at line 46 of file answerInlineQuery.h.

◆ next_offset

std::optional<std::string> yatbcpp::answerInlineQuery::next_offset
private

Definition at line 47 of file answerInlineQuery.h.

◆ results

std::vector<std::shared_ptr<InlineQueryResult> > yatbcpp::answerInlineQuery::results
private

Definition at line 44 of file answerInlineQuery.h.

◆ switch_pm_parameter

std::optional<std::string> yatbcpp::answerInlineQuery::switch_pm_parameter
private

Definition at line 49 of file answerInlineQuery.h.

◆ switch_pm_text

std::optional<std::string> yatbcpp::answerInlineQuery::switch_pm_text
private

Definition at line 48 of file answerInlineQuery.h.


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