From 2deb988e762fc13c834fd44375b77554136e1099 Mon Sep 17 00:00:00 2001 From: muhammad bukhori muslim Date: Mon, 11 Feb 2019 18:44:31 +0700 Subject: [PATCH] Update pesan selamat datang teman anggota baru. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mengatasi @undefined username. biar keliatan si hayati nyapa siapa sebenernya. 👍 --- routes.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/routes.js b/routes.js index 4ff84ea..0f7e6af 100644 --- a/routes.js +++ b/routes.js @@ -41,9 +41,11 @@ const events = [ event: 'new_chat_members', action: context => { const username = context.update.message.from.username; - context.reply(`selamat datang @${username} silahkan perkenalkan diri kak`); + const firstname = context.update.message.from.first_name; + const lastname = context.update.message.from.last_name; + context.reply(`selamat datang **${firstname} ${lastname}** @${username} silahkan perkenalkan diri kak`); }, }, ]; -module.exports = [...hears, ...commands, ...events]; \ No newline at end of file +module.exports = [...hears, ...commands, ...events];