welcome message

This commit is contained in:
karl.hudgell 2020-06-23 11:01:32 +01:00
förälder 8607e4a3a5
incheckning 7b8cb8ed68

5
app.js
Visa fil

@ -20,15 +20,16 @@ const bot = new TelegramBot(token, {
polling: true
});
// Wlecome Message
bot.on('new_chat_members', (msg) => {
const newUserMention = "<a href=\"tg:\/\/user?id=" + msg.new_chat_member.id + "\">@" + 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 = "<a href=\"tg:\/\/user?id=" + msg.from.id + "\">@" + msg.from.first_name + "<\/a>"