Telebot gegen fremde gesichert.

This commit is contained in:
Klaas Börgmann 2024-07-19 17:19:19 +02:00
parent 518cca2ca1
commit 233dce1040
1 changed files with 6 additions and 2 deletions

6
app.js
View File

@ -18,8 +18,12 @@ const bot = new TeleBot(process.env.TELEBOT);
telebotChatID=process.env.TELECHAT; telebotChatID=process.env.TELECHAT;
bot.on('text', (msg) => { bot.on('text', (msg) => {
if (msg.from.id==telebotChatID) {
msg.reply.text(msg.text); msg.reply.text(msg.text);
console.log(msg); } else {
msg.reply.text("Entschuldige, " + msg.from.username + "\nIch darf nicht mit fremden reden.");
log.Info("Telebot-nachricht: " + msg.from.username + " - " + msg.text);
}
}); });
bot.start(); bot.start();