yatbcpp  0.0.1
Yet another Telegram Bot CPP Library
InlineQueryResultCachedAudio.cc
Go to the documentation of this file.
1 #include <iostream>
3 
4 using namespace yatbcpp;
5 using namespace std;
6 
7 InlineQueryResultCachedAudio::InlineQueryResultCachedAudio(std::string id, std::string audio_file_id):
8  InlineQueryResult("audio",id),
9  audio_file_id(audio_file_id)
10 {
11 
12 }
13 
15  InlineQueryResult(InlineQueryResultCachedAudio.type,InlineQueryResultCachedAudio.id),
16  audio_file_id(InlineQueryResultCachedAudio.audio_file_id)
17 {
18  caption = InlineQueryResultCachedAudio.caption;
19 }
20 
22 // Outgoing Section //
24 
25 
27  std::cout << "VoiceJSON" << std::endl;
28  Json::Value Outgoing;
29  Outgoing["type"] = getType();//since this is inherited, get it from above?
30  Outgoing["id"] = getId();
31  Outgoing["audio_file_id"] = getAudio_file_id();
32  if(getCaption()){
33  Outgoing["caption"] = getCaption().value();
34  }
35  //TODO reply markup and input message content
36  return Outgoing;
37 }
38 
40 // Setter Section //
42 
44 // Getter Section //
46 
48  return audio_file_id;
49 }
50 
51 const optional<string> &InlineQueryResultCachedAudio::getCaption() const {
52  return caption;
53 }
const std::string & getType() const
InlineQueryResultCachedAudio(std::string id, std::string audio_file_id)
Definition: Bot.h:27
const std::string & getId() const
const std::optional< std::string > & getCaption() const