def get_telefono(update: Update, context: CallbackContext) -> None:
telefono = update.message.text
context.user_data['telefono'] = telefono
user_data = context.user_data
respuesta = 'Fecha de Vencimiento AAAA-MM-DD'
calendar = telegramcalendar.create_calendar()
update.message.reply_text(respuesta, reply_markup=calendar)
return GET_VENCIMIENTO
def get_vencimiento(update: Update, context: CallbackContext) -> None:
bot = context.bot
selected, date = telegramcalendar.process_calendar_selection(bot, update)
if selected:
respuesta = date.strftime("%d/%m/%Y")
update.message.reply_text(respuesta, reply_markup=ReplyKeyboardRemove())
return GET_PAGO
updater = Updater(settings.TOKEN)
dispatcher = updater.dispatcher
conv_handler = ConversationHandler(
entry_points=[CommandHandler('start', start, Filters.user(username="@cokelopez"))],
states={
GET_TELEFONO: [MessageHandler(Filters.regex('^\+?1?\d{9,15}$'), get_telefono)],
GET_VENCIMIENTO: [CallbackQueryHandler(get_vencimiento)],
},
fallbacks=[CommandHandler('cancel', cancel)],
allow_reentry = True,
)
dispatcher.add_handler(conv_handler)
dispatcher.add_error_handler(error)
mode = os.environ.get("MODE", "polling")
updater.start_polling()
updater.idle()
The calendar is displayed and it start in August 2021 I click to forward to September and it workd, but when I try to forward to October or go back to August it does not work.
I'm using Django as a framework, I just pasted part of the code of my bot, I'm using the Context because I collect the answers.