31 lines
1.5 KiB
Python
31 lines
1.5 KiB
Python
from telegram import Update, KeyboardButton, ReplyKeyboardMarkup
|
|
|
|
async def next_truck(update: Update):
|
|
if update.message.location:
|
|
lat, lon = update.message.location.latitude, update.message.location.longitude
|
|
await update.message.reply_text(
|
|
f"🚛 El camión pasa por tu zona ({lat}, {lon}) mañana a las 8:00 AM.")
|
|
else:
|
|
keyboard = [[KeyboardButton("📍 Enviar ubicación", request_location=True)]]
|
|
markup = ReplyKeyboardMarkup(keyboard, resize_keyboard=True, one_time_keyboard=True)
|
|
await update.message.reply_text(
|
|
"Mándame tu ubicación para decirte cuándo pasa el camión.",
|
|
reply_markup=markup)
|
|
|
|
async def report_trash(update: Update):
|
|
user_text = update.message.text
|
|
await update.message.reply_text(f"🌱 Calculé tu CO₂ por '{user_text}' y te di 5 Monedas Verdes. ¡Chido!")
|
|
|
|
async def private_pickup(update: Update):
|
|
if update.message.location:
|
|
await update.message.reply_text("🛵 ¡Pepe de la motito va en camino! Llega en 10 min.")
|
|
else:
|
|
keyboard = [[KeyboardButton("📍 Enviar ubicación", request_location=True)]]
|
|
markup = ReplyKeyboardMarkup(keyboard, resize_keyboard=True, one_time_keyboard=True)
|
|
await update.message.reply_text(
|
|
"Mándame tu ubicación para buscar un reco privado.",
|
|
reply_markup=markup)
|
|
|
|
async def green_balance(update: Update):
|
|
await update.message.reply_text("💰 Llevas 23 Monedas Verdes acumuladas y evitaste 15 kg CO₂.")
|