@@ 32-47 (lines=16) @@ | ||
29 | // just set $offset as the same value |
|
30 | $offset = $this->redis->get($variable_name); |
|
31 | ||
32 | } else { |
|
33 | // Else get the offset from the id from the first update received |
|
34 | ||
35 | do { |
|
36 | ||
37 | $update = $this->getUpdates(0, 1); |
|
38 | ||
39 | } while (empty($update)); |
|
40 | ||
41 | $offset = $update[0]['update_id']; |
|
42 | ||
43 | $this->redis->set($variable_name, $offset); |
|
44 | ||
45 | $update = null; |
|
46 | ||
47 | } |
|
48 | ||
49 | $this->initBot(); |
|
50 | ||
@@ 177-189 (lines=13) @@ | ||
174 | $sth = null; |
|
175 | ||
176 | // Get the offset from the first update to update |
|
177 | if ($offset === false) { |
|
178 | ||
179 | do { |
|
180 | ||
181 | $update = $this->getUpdates(0, 1); |
|
182 | ||
183 | } while (empty($update)); |
|
184 | ||
185 | $offset = $update[0]['update_id']; |
|
186 | ||
187 | $update = null; |
|
188 | ||
189 | } |
|
190 | ||
191 | // Prepare the query for updating the offset in the database |
|
192 | $sth = $this->pdo->prepare('UPDATE "' . $table_name . '" SET "' . $column_name . '" = :new_offset'); |