Skip to content
A simple inline calendar for Telegram bots
Branch: master
Clone or download
Latest commit 2b65fb1 Nov 7, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Added gitignore file Aug 14, 2016
LICENSE Initial commit Aug 14, 2016 Added reference to renfe-notifier-bot Nov 30, 2017 Added working bot example Nov 30, 2017
example.gif Added example gif Aug 14, 2016 Added telegram options keyboard Jan 22, 2018 FIxed bug in options keyboard Jan 25, 2018

Date Selection tool for Telegram Bots

A simple inline calendar for Telegram bots written in Python using python-telegram-bot. Based on calendar-telegram.


The file proved the API to create an inline keyboard for a Telegram Bot. The user can either select a date or move to the next or previous month by clicking a singe button.


The file provides the user with two methods:

  • create_calendar: This method returns a InlineKeyboardMarkup object with the calendar in the provided year and month.
  • process_calendar_selection: This method can be used inside a CallbackQueryHandler method to check if the user has selected a date or wants to move to a different month. It also creates a new calendar with the same text if necessary.


To use the telecram-calendar-keyboard you need to have python-telegram-bot installed first. A full working example on how to use telegram-calendar-keyboard is provided in As you can see below, you create a calendar and add it to a message with a reply_markup parameter and then you can process it in a callbackqueyhandler method using the process_calendar_selection method:

def calendar_handler(bot,update):
    update.message.reply_text("Please select a date: ",

def inline_handler(bot,update):
    selected,date = telegramcalendar.process_calendar_selection(bot, update)
    if selected:
                        text="You selected %s" % (date.strftime("%d/%m/%Y")),

For a more complex example please check out renfe-notifier-bot


You can’t perform that action at this time.