yatbcpp  0.0.1
Yet another Telegram Bot CPP Library
sendMessage.h
Go to the documentation of this file.
1 //
2 // Created by norbert on 27.08.17.
3 //
4 
5 #ifndef YATBCPP_SENDMESSAGE_H
6 #define YATBCPP_SENDMESSAGE_H
7 
8 #include "../types/Chat.h"
9 #include "../types/Message.h"
10 #include "../types/ReplyKeyboardMarkup.h"
11 #include "../types/ReplyKeyboardMarkup.h"
12 #include "../types/ReplyKeyboardRemove.h"
13 #include "../types/ForceReply.h"
14 #include "telegram_methodJSON.h"
15 
16 namespace yatbcpp{
17  class sendMessage : public telegram_methodJSON<Message>{
18  public:
19 
20  Json::Value toJson();
21 
22  sendMessage(std::int64_t chat_id,std::string text);
23 
24  sendMessage(std::string chat_id,std::string text);
25 
26  sendMessage(Chat C, std::string text);
27 
28  void setParse_mode(const std::optional<std::string> &parse_mode);
29 
30  void setDisable_web_page_preview(const std::optional<bool> &disable_web_page_preview);
31 
32  void setDisable_notification(const std::optional<bool> &disable_notification);
33 
34  void setReply_to_message_id(const std::optional<std::int32_t> &reply_to_message_id);
35 
36  void setReplyMarkup(const ReplyKeyboardMarkup RKM);
37  void setReplyMarkup(const ReplyKeyboardRemove RKR);
38  void setReplyMarkup(const ForceReply FR);
39 
40  const std::string &getChat_id() const;
41 
42  const std::string &getText() const;
43 
44  const std::optional<std::string> &getParse_mode() const;
45 
46  const std::optional<bool> &getDisable_web_page_preview() const;
47 
48  const std::optional<bool> &getDisable_notification() const;
49 
50  const std::optional<std::int32_t> &getReply_to_message_id() const;
51 
52  const std::optional<ReplyMarkup> &getReply_markup() const;
53 
54 
55  private:
56  std::string chat_id;//Maybe simpler because @username or chat_id
57  std::string text;
58  std::optional<std::string> parse_mode;
59  std::optional<bool> disable_web_page_preview;
60  std::optional<bool> disable_notification;
61  std::optional<std::int32_t> reply_to_message_id;
62  std::optional<ReplyMarkup> reply_markup;
63  };
64 }
65 
66 #endif //YATBCPP_SENDMESSAGE_H
void setReply_to_message_id(const std::optional< std::int32_t > &reply_to_message_id)
Definition: sendMessage.cc:76
sendMessage(std::int64_t chat_id, std::string text)
const std::string & getChat_id() const
Definition: sendMessage.cc:108
const std::optional< std::int32_t > & getReply_to_message_id() const
Definition: sendMessage.cc:128
void setParse_mode(const std::optional< std::string > &parse_mode)
Definition: sendMessage.cc:64
std::optional< std::int32_t > reply_to_message_id
Definition: sendMessage.h:61
std::string text
Definition: sendMessage.h:57
void setReplyMarkup(const ReplyKeyboardMarkup RKM)
Definition: sendMessage.cc:84
Definition: Bot.h:27
std::optional< bool > disable_web_page_preview
Definition: sendMessage.h:59
const std::optional< bool > & getDisable_web_page_preview() const
Definition: sendMessage.cc:120
const std::string & getText() const
Definition: sendMessage.cc:112
std::optional< ReplyMarkup > reply_markup
Definition: sendMessage.h:62
void setDisable_notification(const std::optional< bool > &disable_notification)
Definition: sendMessage.cc:72
const std::optional< std::string > & getParse_mode() const
Definition: sendMessage.cc:116
const std::optional< bool > & getDisable_notification() const
Definition: sendMessage.cc:124
Json::Value toJson()
Definition: sendMessage.cc:39
void setDisable_web_page_preview(const std::optional< bool > &disable_web_page_preview)
Definition: sendMessage.cc:68
std::optional< bool > disable_notification
Definition: sendMessage.h:60
const std::optional< ReplyMarkup > & getReply_markup() const
Definition: sendMessage.cc:132
std::string chat_id
Definition: sendMessage.h:56
std::optional< std::string > parse_mode
Definition: sendMessage.h:58