fix: redundant contact check

This commit is contained in:
Mohamed Sohail 2022-01-17 18:13:52 +03:00
parent c51fc24478
commit 1e438ae73e
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D

View File

@ -77,7 +77,7 @@ bot.on("msg:contact", async (ctx) => {
log.debug(ctx.update, "msg:contact received");
const contact = ctx.msg.contact;
if (ctx.msg.reply_to_message.from.is_bot && ctx.from.id === contact.user_id) {
if (ctx.from.id === contact.user_id) {
if (contact.phone_number.slice(0, 4) !== "+254") {
return ctx.reply("Sarafu is only available in Kenya at the moment.");
}
@ -89,7 +89,6 @@ bot.on("msg:contact", async (ctx) => {
);
}
log.info(ctx.update.user, "contact spoof attempted");
return ctx.reply("Could not verify sent contact.");
});