Dooratre commited on
Commit
da35a53
·
verified ·
1 Parent(s): d8673bf

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +55 -18
index.html CHANGED
@@ -1,19 +1,56 @@
1
- <!doctype html>
2
  <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
  <html>
3
+ <head>
4
+ <title>Telegram Bot</title>
5
+ </head>
6
+ <body>
7
+ <h1>BOT TELE RUN</h1>
8
+
9
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js"></script>
10
+ <script>
11
+ // Replace 'YOUR_BOT_TOKEN' with your actual bot token
12
+ const botToken = '7405960993:AAH1YTmoam4-Afk_QHsAcAObrdXwAlzfsaQ';
13
+ function sendMessage(chatId, text) {
14
+ const url = `https://api.telegram.org/bot${botToken}/sendMessage`;
15
+ const params = { chat_id: chatId, text: text };
16
+ axios.get(url, { params })
17
+ .then(response => {
18
+ console.log(response.data);
19
+ })
20
+ .catch(error => {
21
+ console.error(error);
22
+ });
23
+ }
24
+ function handleMessage(message) {
25
+ const chatId = message.chat.id;
26
+ const text = message.text;
27
+ if (text === '/start') {
28
+ sendMessage(chatId, 'Hi');
29
+ }
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>