AsyncTelegram2

Loading...
Searching...
No Matches
DataStructures.h
Go to the documentation of this file.
1
2#ifndef DATA_STRUCTURES
3#define DATA_STRUCTURES
4
5#define BUFFER_BIG 2048 // json parser buffer size (ArduinoJson v6)
6#define BUFFER_MEDIUM 1024 // json parser buffer size (ArduinoJson v6)
7#define BUFFER_SMALL 512 // json parser buffer size (ArduinoJson v6)
8
9 enum MessageType {
10 MessageNoData = 0,
11 MessageText = 1,
12 MessageQuery = 2,
13 MessageLocation = 3,
14 MessageContact = 4,
15 MessageDocument = 5,
16 MessageReply = 6,
17 MessageNewMember = 7,
18 MessageLeftMember =8,
19 MessageForwarded = 9
20};
21
22 struct TBUser {
23 bool isBot;
24 int64_t id = 0;
25 String firstName;
26 String lastName;
27 String username;
28};
29
30 struct TBLocation{
31 float longitude;
32 float latitude;
33};
34
35 struct TBContact {
36 int64_t id;
37 String phoneNumber;
38 String firstName;
39 String lastName;
40 String vCard;
41};
42
43 struct TBDocument {
44 bool file_exists;
45 int32_t file_size;
46 String file_id;
47 String file_name;
48 String file_path;
49};
50
51 struct TBMessage {
52 MessageType messageType;
53 bool isHTMLenabled = true;
54 bool isMarkdownEnabled = false;
55 bool disable_notification = false;
56 bool force_reply = false;
57 int32_t date;
58 int32_t chatInstance;
59 int64_t chatId;
60 int32_t messageID;
61 TBUser sender;
62 TBUser member; // A user enter or leave a group
63 TBLocation location;
64 TBContact contact;
65 TBDocument document;
66 int64_t callbackQueryID;
67 String callbackQueryData;
68 String text;
69};
70
71#endif
72
MessageType
MessageType
Definition: DataStructures.h:9
MessageDocument
@ MessageDocument
Definition: DataStructures.h:15
MessageNewMember
@ MessageNewMember
Definition: DataStructures.h:17
MessageForwarded
@ MessageForwarded
Definition: DataStructures.h:19
MessageText
@ MessageText
Definition: DataStructures.h:11
MessageNoData
@ MessageNoData
Definition: DataStructures.h:10
MessageReply
@ MessageReply
Definition: DataStructures.h:16
MessageLocation
@ MessageLocation
Definition: DataStructures.h:13
MessageQuery
@ MessageQuery
Definition: DataStructures.h:12
MessageContact
@ MessageContact
Definition: DataStructures.h:14
MessageLeftMember
@ MessageLeftMember
Definition: DataStructures.h:18
TBContact
Definition: DataStructures.h:35
TBContact::phoneNumber
String phoneNumber
Definition: DataStructures.h:37
TBContact::firstName
String firstName
Definition: DataStructures.h:38
TBContact::vCard
String vCard
Definition: DataStructures.h:40
TBContact::lastName
String lastName
Definition: DataStructures.h:39
TBContact::id
int64_t id
Definition: DataStructures.h:36
TBDocument
Definition: DataStructures.h:43
TBDocument::file_size
int32_t file_size
Definition: DataStructures.h:45
TBDocument::file_exists
bool file_exists
Definition: DataStructures.h:44
TBDocument::file_path
String file_path
Definition: DataStructures.h:48
TBDocument::file_name
String file_name
Definition: DataStructures.h:47
TBDocument::file_id
String file_id
Definition: DataStructures.h:46
TBLocation
Definition: DataStructures.h:30
TBLocation::latitude
float latitude
Definition: DataStructures.h:32
TBLocation::longitude
float longitude
Definition: DataStructures.h:31
TBMessage
Definition: DataStructures.h:51
TBMessage::contact
TBContact contact
Definition: DataStructures.h:64
TBMessage::member
TBUser member
Definition: DataStructures.h:62
TBMessage::isHTMLenabled
bool isHTMLenabled
Definition: DataStructures.h:53
TBMessage::text
String text
Definition: DataStructures.h:68
TBMessage::disable_notification
bool disable_notification
Definition: DataStructures.h:55
TBMessage::chatId
int64_t chatId
Definition: DataStructures.h:59
TBMessage::document
TBDocument document
Definition: DataStructures.h:65
TBMessage::isMarkdownEnabled
bool isMarkdownEnabled
Definition: DataStructures.h:54
TBMessage::callbackQueryID
int64_t callbackQueryID
Definition: DataStructures.h:66
TBMessage::date
int32_t date
Definition: DataStructures.h:57
TBMessage::callbackQueryData
String callbackQueryData
Definition: DataStructures.h:67
TBMessage::sender
TBUser sender
Definition: DataStructures.h:61
TBMessage::chatInstance
int32_t chatInstance
Definition: DataStructures.h:58
TBMessage::messageType
MessageType messageType
Definition: DataStructures.h:52
TBMessage::location
TBLocation location
Definition: DataStructures.h:63
TBMessage::force_reply
bool force_reply
Definition: DataStructures.h:56
TBMessage::messageID
int32_t messageID
Definition: DataStructures.h:60
TBUser
Definition: DataStructures.h:22
TBUser::firstName
String firstName
Definition: DataStructures.h:25
TBUser::isBot
bool isBot
Definition: DataStructures.h:23
TBUser::username
String username
Definition: DataStructures.h:27
TBUser::lastName
String lastName
Definition: DataStructures.h:26