fix: tg contact behaviour

* sometimes  atg update does not include a plus symbol
This commit is contained in:
Mohamed Sohail 2022-01-18 15:51:11 +03:00
parent aace2e98e1
commit 4530c7105d
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D

View File

@ -78,7 +78,10 @@ bot.on("msg:contact", async (ctx) => {
const contact = ctx.msg.contact; const contact = ctx.msg.contact;
if (ctx.from.id === contact.user_id) { 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."); return ctx.reply("Sarafu is only available in Kenya at the moment.");
} }