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