Compare commits

...

2 Commits

Author SHA1 Message Date
Mohamed Sohail 5257967f88
release: v0.2.2 2022-01-17 18:14:08 +03:00
Mohamed Sohail 1e438ae73e
fix: redundant contact check 2022-01-17 18:13:52 +03:00
2 changed files with 2 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ussd-tg-proxy",
"version": "0.2.1",
"version": "0.2.2",
"description": "ussd-tg-proxy",
"main": "src/index.js",
"repository": "https://git.grassecon.net/grassrootseconomics/ussd-tg-proxy.git",

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