Spaces:
Configuration error
Configuration error
Lee Thanh
commited on
Commit
•
a408505
1
Parent(s):
2e8e242
Update index.js
Browse files
index.js
CHANGED
@@ -6,7 +6,8 @@ const cloudflareToken = 'NB-sxyNA3JSyhezy2fUnTnXc3Pf7i8X17BJfBwLx';
|
|
6 |
|
7 |
const bot = new TelegramBot(telegramToken, {polling: true});
|
8 |
|
9 |
-
console.log('
|
|
|
10 |
|
11 |
bot.on('message', (msg) => {
|
12 |
const chatId = msg.chat.id;
|
@@ -22,6 +23,7 @@ bot.on('message', (msg) => {
|
|
22 |
const aiResponse = response.data.result.response;
|
23 |
bot.sendMessage(chatId, aiResponse);
|
24 |
}).catch(error => {
|
|
|
25 |
console.error(error);
|
26 |
});
|
27 |
});
|
|
|
6 |
|
7 |
const bot = new TelegramBot(telegramToken, {polling: true});
|
8 |
|
9 |
+
console.log('Load bot success..')
|
10 |
+
console.log('Can use!')
|
11 |
|
12 |
bot.on('message', (msg) => {
|
13 |
const chatId = msg.chat.id;
|
|
|
23 |
const aiResponse = response.data.result.response;
|
24 |
bot.sendMessage(chatId, aiResponse);
|
25 |
}).catch(error => {
|
26 |
+
bot.sendMessage(chatId, 'Something wrong please send again message!');
|
27 |
console.error(error);
|
28 |
});
|
29 |
});
|