yatbcpp  0.0.1
Yet another Telegram Bot CPP Library
MessageEntity.h
Go to the documentation of this file.
1 //
2 // Created by norbert on 23.08.17.
3 //
4 
5 #ifndef YATBCPP_MESSAGEENTITY_H
6 #define YATBCPP_MESSAGEENTITY_H
7 
8 #include <string>
9 #include <optional>
10 #include "User.h"
11 
12 namespace yatbcpp{
14  class MessageEntity {
15  public:
16  MessageEntity(std::string type,std::int32_t offset, std::int32_t length);
17 
19 
20  void setUrl(const std::optional<std::string> &url);
21 
22  void setUser(const std::optional<User> &user);
23 
24  const std::string &getType() const;
25 
26  std::int32_t getOffset() const;
27 
28  std::int32_t getLength() const;
29 
30  const std::optional<std::string> &getUrl() const;
31 
32  const std::optional<User> &getUser() const;
33 
34  private:
35  std::string type;
36  std::int32_t offset;
37  std::int32_t length;
38  std::optional<std::string> url;//only when text_link, vll eher lieber vererben
39  std::optional<User> user;//only when text_metnion
40 
41  };
42 
43 }
44 
45 #endif //YATBCPP_MESSAGEENTITY_H
std::int32_t getOffset() const
const std::optional< std::string > & getUrl() const
const std::optional< User > & getUser() const
Definition: Bot.h:27
MessageEntity(std::string type, std::int32_t offset, std::int32_t length)
std::optional< std::string > url
Definition: MessageEntity.h:38
void setUrl(const std::optional< std::string > &url)
void setUser(const std::optional< User > &user)
std::optional< User > user
Definition: MessageEntity.h:39
const std::string & getType() const
std::int32_t getLength() const