From 4530c7105d4497b0ae1249c59f13b30727e1fd51 Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Tue, 18 Jan 2022 15:51:11 +0300 Subject: [PATCH] fix: tg contact behaviour * sometimes atg update does not include a plus symbol --- src/bot.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bot.js b/src/bot.js index 5bee62b..cd88529 100644 --- a/src/bot.js +++ b/src/bot.js @@ -78,7 +78,10 @@ bot.on("msg:contact", async (ctx) => { const contact = ctx.msg.contact; if (ctx.from.id === contact.user_id) { - if (contact.phone_number.slice(0, 4) !== "+254") { + if ( + contact.phone_number.slice(0, 4) !== "+254" || + contact.phone_number.slice(0, 3) !== "254" + ) { return ctx.reply("Sarafu is only available in Kenya at the moment."); }