-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathderde.js
More file actions
22 lines (16 loc) · 784 Bytes
/
Copy pathderde.js
File metadata and controls
22 lines (16 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const TeleBot = require('telebot');
const bot = new TeleBot({
token: '421511573:AAEuIpP0J9ImJCoWMgh_5vke6rxaT-Rj0ZA', // Required. Telegram Bot API token.
});
//bot.on('text', (msg) => msg.reply.text(msg.text));
bot.on(/^\/say (.+)$/, (msg, props) => {
const text = props.match[1];
return bot.sendMessage(msg.from.id, text, { replyToMessage: msg.message_id });
});
bot.on('/hello', function (msg) {
return bot.sendMessage(msg.from.id, `Hello, ${ msg.from.first_name }!`);
});
bot.on('/historie', (msg) => {
return bot.sendPhoto(msg.from.id, "mauritskade58.jpg", { replyToMessage: msg.message_id }); // sendPhoto(<chat_id>, <file_id | path | url | buffer | stream>, {caption, fileName, serverDownload, replyToMessage, replyMarkup, notification})
});
bot.start();