File tree 3 files changed +39
-1
lines changed
3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 1
1
name =FastBot2
2
- version =1.0.5
2
+ version =1.0.6
3
3
author =AlexGyver <alex@alexgyver.ru>
4
4
maintainer =AlexGyver <alex@alexgyver.ru>
5
5
sentence =Fast and universal Arduino/ESP8266/ESP32 library for Telegram bot
Original file line number Diff line number Diff line change @@ -57,6 +57,11 @@ class Core : public Http {
57
57
http.setTimeout (timeout);
58
58
}
59
59
60
+ // получить таймаут ожидания ответа сервера
61
+ uint16_t getTimeout () {
62
+ return _clientTout;
63
+ }
64
+
60
65
// ============================== SYSTEM ==============================
61
66
62
67
// установить токен
@@ -74,11 +79,21 @@ class Core : public Http {
74
79
_limit = limit;
75
80
}
76
81
82
+ // получить лимит памяти на ответ сервера
83
+ size_t getMemLimit (void ) {
84
+ return _limit;
85
+ }
86
+
77
87
// установить лимит - кол-во сообщений в одном обновлении (умолч. 3)
78
88
void setLimit (uint8_t limit = 3 ) {
79
89
_poll_limit = limit ? limit : 1 ;
80
90
}
81
91
92
+ // получить лимит - кол-во сообщений в одном обновлении
93
+ uint8_t getLimit (void ) {
94
+ return _limit;
95
+ }
96
+
82
97
// установить режим и период опроса (умолч. Poll::Sync и 4000 мс)
83
98
void setPollMode (Poll mode = Poll::Sync, uint16_t period = 4000 ) {
84
99
_poll_mode = mode;
@@ -90,6 +105,11 @@ class Core : public Http {
90
105
return _poll_mode;
91
106
}
92
107
108
+ // получить период опроса
109
+ uint16_t getPollPeriod () {
110
+ return _poll_prd;
111
+ }
112
+
93
113
// пропустить непрочитанные сообщения, отрицательное число, соответствует количеству пропусков. Вызывать однократно
94
114
// https://core.telegram.org/bots/api#getupdates
95
115
void skipUpdates (int32_t offset = -1 ) {
Original file line number Diff line number Diff line change @@ -13,11 +13,25 @@ class Http {
13
13
// установить proxy
14
14
void setProxy (const char * host, uint16_t port) {
15
15
http.setHost (host, port);
16
+ _ip.fromString (host);
17
+ _port = port;
16
18
}
17
19
18
20
// установить proxy
19
21
void setProxy (const IPAddress& ip, uint16_t port) {
20
22
http.setHost (ip, port);
23
+ _ip = ip;
24
+ _port = port;
25
+ }
26
+
27
+ // получить proxy IP
28
+ const IPAddress& getProxyIP () {
29
+ return _ip;
30
+ }
31
+
32
+ // Получить proxy port
33
+ uint16_t getProxyPort () {
34
+ return _port;
21
35
}
22
36
23
37
// удалить proxy
@@ -27,6 +41,10 @@ class Http {
27
41
28
42
protected:
29
43
ghttp::Client http;
44
+
45
+ private:
46
+ IPAddress _ip;
47
+ uint16_t _port;
30
48
};
31
49
32
50
} // namespace fb
You can’t perform that action at this time.
0 commit comments