fix: redundant contact check
This commit is contained in:
		
							parent
							
								
									c51fc24478
								
							
						
					
					
						commit
						1e438ae73e
					
				| @ -77,7 +77,7 @@ bot.on("msg:contact", async (ctx) => { | |||||||
|   log.debug(ctx.update, "msg:contact received"); |   log.debug(ctx.update, "msg:contact received"); | ||||||
|   const contact = ctx.msg.contact; |   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") { |     if (contact.phone_number.slice(0, 4) !== "+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."); | ||||||
|     } |     } | ||||||
| @ -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."); |   return ctx.reply("Could not verify sent contact."); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user