SamiKoen Claude commited on
Commit
a817526
·
1 Parent(s): ef1a3a8

fix: resolve time module import conflict in image sending

Browse files

- Change import time to import time as time_module
- Fix "local variable 'time' referenced before assignment" error
- Ensure proper module scoping for sleep function

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1582,8 +1582,8 @@ async def whatsapp_webhook(request: Request):
1582
  # Eğer ürün sorgusu ise ve son parça gönderildiyse, ürün resmi göndermeyi dene
1583
  if message_body and any(keyword in message_body.lower() for keyword in ['marlin', 'madone', 'trek', 'bisiklet', 'bike', 'fiyat', 'stok']):
1584
  try:
1585
- import time
1586
- time.sleep(1) # Mesaj gönderimi bitmesi için kısa bekleme
1587
 
1588
  # Yanıttan ürün adını bulmaya çalış
1589
  potential_product_names = ['marlin 4 gen 3', 'marlin 4', 'marlin 6', 'marlin 5', 'madone', 'fuel', 'domane']
 
1582
  # Eğer ürün sorgusu ise ve son parça gönderildiyse, ürün resmi göndermeyi dene
1583
  if message_body and any(keyword in message_body.lower() for keyword in ['marlin', 'madone', 'trek', 'bisiklet', 'bike', 'fiyat', 'stok']):
1584
  try:
1585
+ import time as time_module
1586
+ time_module.sleep(1) # Mesaj gönderimi bitmesi için kısa bekleme
1587
 
1588
  # Yanıttan ürün adını bulmaya çalış
1589
  potential_product_names = ['marlin 4 gen 3', 'marlin 4', 'marlin 6', 'marlin 5', 'madone', 'fuel', 'domane']