Dooratre commited on
Commit
361b655
·
verified ·
1 Parent(s): fb7534f

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +17 -16
index.html CHANGED
@@ -30,26 +30,27 @@
30
  }
31
  function main() {
32
  let offset = null;
33
- const url = `https://api.telegram.org/bot${botToken}/getUpdates`;
34
- const params = { offset };
35
- axios.get(url, { params })
36
- .then(response => {
37
- const data = response.data;
38
- if (data.ok) {
39
- for (const update of data.result) {
40
- offset = update.update_id + 1;
41
- if (update.message) {
42
- handleMessage(update.message);
 
 
43
  }
44
  }
45
- }
46
- })
47
- .catch(error => {
48
- console.error(error);
49
- });
50
  }
51
  main();
52
- setInterval(main, 1000);
53
  </script>
54
  </body>
55
  </html>
 
30
  }
31
  function main() {
32
  let offset = null;
33
+ setInterval(() => {
34
+ const url = `https://api.telegram.org/bot${botToken}/getUpdates`;
35
+ const params = { offset };
36
+ axios.get(url, { params })
37
+ .then(response => {
38
+ const data = response.data;
39
+ if (data.ok) {
40
+ for (const update of data.result) {
41
+ offset = update.update_id + 1;
42
+ if (update.message) {
43
+ handleMessage(update.message);
44
+ }
45
  }
46
  }
47
+ })
48
+ .catch(error => {
49
+ console.error(error);
50
+ });
51
+ }, 1000);
52
  }
53
  main();
 
54
  </script>
55
  </body>
56
  </html>