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
1 changed files with 4 additions and 1 deletions

View File

@ -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.");
}