Skip to content

Commit 3b7b2ac

Browse files
committed
Update FastBot.h
1 parent abefd00 commit 3b7b2ac

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/FastBot.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,16 @@ static HTTPClient _FB_httpGet;
125125
class FastBot {
126126
public:
127127
// инициализация (токен, макс кол-во сообщений на запрос, макс символов, период)
128-
FastBot(String token = "") {
128+
FastBot(String token = "", uint16_t limit = 10, uint16_t ovf = 0, uint16_t period = 3600) {
129129
_token.reserve(46);
130130
chatIDs.reserve(10);
131131
_token = token;
132+
_limit = limit;
133+
_ovf = ovf;
134+
_prd = period;
132135
setBufferSizes(512, 512);
133136
_FB_client.setInsecure();
134-
//_FB_httpGet.setTimeout(1000);
137+
//_FB_httpGet.setTimeout(500);
135138
}
136139

137140
// ===================== НАСТРОЙКИ =====================
@@ -729,7 +732,6 @@ class FastBot {
729732
}
730733

731734
uint8_t parse(const String& str, uint16_t size) {
732-
Serial.println(size);
733735
ovfFlag = size > 25000; // 1 полное сообщение на русском языке или ~5 на английском
734736
if (ovfFlag) return 2;
735737
if (!str.startsWith(F("{\"ok\":true"))) return 3; // ошибка запроса (неправильный токен итд)
@@ -825,7 +827,7 @@ class FastBot {
825827
void (*_callback)(FB_msg& msg) = nullptr;
826828
String _token;
827829
String* _query = nullptr;
828-
uint16_t _prd, _limit;
830+
uint16_t _ovf, _prd, _limit;
829831
int32_t ID = 0;
830832
uint32_t tmr = 0;
831833
bool _incr = true;

0 commit comments

Comments
 (0)