Telebot gegen fremde gesichert.
This commit is contained in:
		
							parent
							
								
									518cca2ca1
								
							
						
					
					
						commit
						233dce1040
					
				
							
								
								
									
										8
									
								
								app.js
								
								
								
								
							
							
						
						
									
										8
									
								
								app.js
								
								
								
								
							| 
						 | 
					@ -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) => {
 | 
				
			||||||
  msg.reply.text(msg.text);
 | 
					  if (msg.from.id==telebotChatID) {
 | 
				
			||||||
  console.log(msg);
 | 
					    msg.reply.text(msg.text);
 | 
				
			||||||
 | 
					  } 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();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue