From 7b8cb8ed684b95775c3c11960958e03be485ba16 Mon Sep 17 00:00:00 2001 From: "karl.hudgell" Date: Tue, 23 Jun 2020 11:01:32 +0100 Subject: [PATCH] welcome message --- app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 7ec352a..61c5f85 100644 --- a/app.js +++ b/app.js @@ -20,15 +20,16 @@ const bot = new TelegramBot(token, { polling: true }); - +// Wlecome Message bot.on('new_chat_members', (msg) => { const newUserMention = "@" + msg.new_chat_member.first_name + "<\/a>" - bot.sendMessage(msg.chat.id, newUserMention + " you bastard", { parse_mode: "HTML" }); + bot.sendMessage(msg.chat.id,"Hello " + newUserMention + ", Welcome to " + channel + ". \n\nPlease PM me @" + process.env.BOT_USERNAME + " to find out all needed information about our service before asking an admin or posting in here.\n\nIf you do ask questions, and its obvious you have not spoken to me, we might not take it well.", { parse_mode: "HTML" }); logger.info("ID - " + msg.new_chat_member.id + " First Name - " + msg.new_chat_member.first_name + " joined the group"); }); bot.on('message', (msg) => { + // Listen call for "help" const help = "help"; if (msg.text && msg.text.toString().toLowerCase().includes(help)) { const userMention = "@" + msg.from.first_name + "<\/a>"