{"id":13772997,"url":"https://github.com/VDS13/telegram-inline-calendar","last_synced_at":"2025-05-11T05:34:16.385Z","repository":{"id":64991508,"uuid":"580343729","full_name":"VDS13/telegram-inline-calendar","owner":"VDS13","description":"Date and time picker and Inline calendar for Node.js telegram bots","archived":false,"fork":false,"pushed_at":"2025-03-26T12:53:47.000Z","size":36799,"stargazers_count":98,"open_issues_count":1,"forks_count":19,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T11:07:25.878Z","etag":null,"topics":["calendar","grammy","inline-keyboard","node-telegram-bot-api","telebot","telegraf","telegram","telegram-bot","time","time-selector"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VDS13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-20T10:27:22.000Z","updated_at":"2025-04-18T13:10:14.000Z","dependencies_parsed_at":"2025-03-17T12:30:33.221Z","dependency_job_id":"61371c2f-4bf6-4eae-baef-d11bee46f414","html_url":"https://github.com/VDS13/telegram-inline-calendar","commit_stats":{"total_commits":52,"total_committers":3,"mean_commits":"17.333333333333332","dds":"0.46153846153846156","last_synced_commit":"138eed9191264777deae723f2ea91329cd17abaa"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VDS13%2Ftelegram-inline-calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VDS13%2Ftelegram-inline-calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VDS13%2Ftelegram-inline-calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VDS13%2Ftelegram-inline-calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VDS13","download_url":"https://codeload.github.com/VDS13/telegram-inline-calendar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253523690,"owners_count":21921815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calendar","grammy","inline-keyboard","node-telegram-bot-api","telebot","telegraf","telegram","telegram-bot","time","time-selector"],"created_at":"2024-08-03T17:01:10.078Z","updated_at":"2025-05-11T05:34:16.377Z","avatar_url":"https://github.com/VDS13.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003etelegram-inline-calendar\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\nDate and time picker and inline calendar for Node.js telegram bots.\n\n\n[![Bot API](https://img.shields.io/badge/Bot%20API-v.6.3-00aced.svg?style=flat-square\u0026logo=telegram)](https://core.telegram.org/bots/api)\n[![npm package](https://img.shields.io/npm/v/telegram-inline-calendar?logo=npm\u0026style=flat-square)](https://www.npmjs.org/package/telegram-inline-calendar)\n[![npm download](https://img.shields.io/npm/dt/telegram-inline-calendar)](https://www.npmjs.org/package/telegram-inline-calendar)\n\n\u003c/div\u003e\n\n## 📙 Description\n\nUsing this simple inline calendar you can allow your Telegram bot to ask dates.\n\n\u003cimg src=\"https://github.com/VDS13/telegram-inline-calendar/blob/main/img/demo2.gif\" width=\"400\"/\u003e\n\nSupported languages:\n* English\n* French\n* Russian\n* Spanish\n* Italian\n* German\n* Turkish\n* Indonesian\n* Ukrainian\n* Brazilian Portuguese (pt-br)\n\nSupported Telegram bot libraries:\n* [Telegraf](https://github.com/telegraf/telegraf)\n* [node-telegram-bot-api](https://github.com/yagop/node-telegram-bot-api)\n* [telebot](https://github.com/mullwar/telebot)\n* [grammY](https://github.com/grammyjs/grammY)\n\n## 📦 Install\nThere are two versions:\n### v1.x - if you are using CommonJS modules\n```sh\nnpm i telegram-inline-calendar\n```\n### v2.x - if you are using ES modules\n```sh\nnpm i telegram-inline-calendar@ecmascript\n```\n\u003e ✍️ **Note:** If you use Typescript you can install this package that contains type definitions for this library\n\u003e```sh\n\u003enpm install --save-dev telegram-inline-calendar-types\n\u003e```\n\n## 🎚️ Changelog ([v1.x](https://github.com/VDS13/telegram-inline-calendar/blob/main/v1.x/CHANGELOG.md) or [v2.x](https://github.com/VDS13/telegram-inline-calendar/blob/main/v2.x/CHANGELOG.md))\n\n## 🗺 API ([v1.x](https://github.com/VDS13/telegram-inline-calendar/blob/main/v1.x/API.md) or [v2.x](https://github.com/VDS13/telegram-inline-calendar/blob/main/v2.x/API.md))\n\n## 🖥️ Examples ([v1.x](https://github.com/VDS13/telegram-inline-calendar/blob/main/v1.x/EXAMPLES.md) or [v2.x](https://github.com/VDS13/telegram-inline-calendar/blob/main/v2.x/EXAMPLES.md))\n\n## 🚀 Usage\n\n### node-telegram-bot-api\n\n#### CommonJS\n```js\nconst TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';\n\nconst TelegramBot = require('node-telegram-bot-api');\nconst Calendar = require('telegram-inline-calendar');\nprocess.env.NTBA_FIX_319 = 1;\nconst bot = new TelegramBot(TOKEN, {polling: true});\nconst calendar = new Calendar(bot, {\n    date_format: 'DD-MM-YYYY',\n    language: 'en'\n});\n\n\nbot.onText(/\\/start/, (msg) =\u003e calendar.startNavCalendar(msg));\n\nbot.on(\"callback_query\", (query) =\u003e {\n    if (query.message.message_id == calendar.chats.get(query.message.chat.id)) {\n        res = calendar.clickButtonCalendar(query);\n        if (res !== -1) {\n            bot.sendMessage(query.message.chat.id, \"You selected: \" + res);\n        }\n    }\n});\n```\n\n#### ESM\n```js\nconst TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';\n\nimport TelegramBot from 'node-telegram-bot-api';\nimport {Calendar} from 'telegram-inline-calendar';\nprocess.env.NTBA_FIX_319 = 1;\nconst bot = new TelegramBot(TOKEN, {polling: true});\nconst calendar = new Calendar(bot, {\n    date_format: 'DD-MM-YYYY',\n    language: 'en'\n});\n\n\nbot.onText(/\\/start/, (msg) =\u003e calendar.startNavCalendar(msg));\n\nbot.on(\"callback_query\", (query) =\u003e {\n    if (query.message.message_id == calendar.chats.get(query.message.chat.id)) {\n        var res;\n        res = calendar.clickButtonCalendar(query);\n        if (res !== -1) {\n            bot.sendMessage(query.message.chat.id, \"You selected: \" + res);\n        }\n    }\n});\n```\n\n### telegraf\n\n#### CommonJS\n```js\nconst TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';\n\nconst {Telegraf} = require('telegraf');\nconst Calendar = require('telegram-inline-calendar');\nconst bot = new Telegraf(TOKEN);\nconst calendar = new Calendar(bot, {\n    date_format: 'DD-MM-YYYY',\n    language: 'en',\n    bot_api: 'telegraf'\n});\n\nbot.start((ctx) =\u003e calendar.startNavCalendar(ctx.message));\n\nbot.on(\"callback_query\", (ctx) =\u003e {\n    if (ctx.callbackQuery.message.message_id == calendar.chats.get(ctx.callbackQuery.message.chat.id)) {\n        res = calendar.clickButtonCalendar(ctx.callbackQuery);\n        if (res !== -1) {\n            bot.telegram.sendMessage(ctx.callbackQuery.message.chat.id, \"You selected: \" + res);\n        }\n    }\n});\nbot.launch();\nprocess.once('SIGINT', () =\u003e bot.stop('SIGINT'));\nprocess.once('SIGTERM', () =\u003e bot.stop('SIGTERM'));\n```\n\n#### ESM\n```js\nconst TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';\n\nimport {Telegraf} from 'telegraf';\nimport {Calendar} from 'telegram-inline-calendar';\nconst bot = new Telegraf(TOKEN, {polling: true});\nconst calendar = new Calendar(bot, {\n    date_format: 'DD-MM-YYYY',\n    language: 'en',\n    bot_api: 'telegraf'\n});\n\nbot.start((ctx) =\u003e calendar.startNavCalendar(ctx));\n\nbot.on(\"callback_query\", (ctx) =\u003e {\n    if (ctx.callbackQuery.message.message_id == calendar.chats.get(ctx.callbackQuery.message.chat.id)) {\n        var res;\n        res = calendar.clickButtonCalendar(ctx);\n        if (res !== -1) {\n            ctx.reply(\"You selected: \" + res);\n        }\n    }\n});\nbot.launch();\nprocess.once('SIGINT', () =\u003e bot.stop('SIGINT'));\nprocess.once('SIGTERM', () =\u003e bot.stop('SIGTERM'));\n```\n\n### telebot\n\n#### CommonJS\n```js\nconst TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';\n\nconst Telebot = require('telebot');\nconst Calendar = require('telegram-inline-calendar');\nconst bot = new Telebot(TOKEN);\nconst calendar = new Calendar(bot, {\n    date_format: 'DD-MM-YYYY',\n    language: 'en',\n    bot_api: 'telebot'\n});\n\n\nbot.on('/start', (msg) =\u003e calendar.startNavCalendar(msg));\n\nbot.on(\"callbackQuery\", (query) =\u003e {\n    if (query.message.message_id == calendar.chats.get(query.message.chat.id)) {\n        res = calendar.clickButtonCalendar(query);\n        if (res !== -1) {\n            bot.sendMessage(query.message.chat.id, \"You selected: \" + res);\n        }\n    }\n});\nbot.connect();\n```\n\n#### ESM\n```js\nconst TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';\n\nimport Telebot from 'telebot';\nimport {Calendar} from 'telegram-inline-calendar';\nconst bot = new Telebot(TOKEN, {polling: true});\nconst calendar = new Calendar(bot, {\n    date_format: 'DD-MM-YYYY',\n    language: 'en',\n    bot_api: 'telebot'\n});\n\nbot.on('/start', (msg) =\u003e calendar.startNavCalendar(msg));\n\nbot.on(\"callbackQuery\", (query) =\u003e {\n    if (query.message.message_id == calendar.chats.get(query.message.chat.id)) {\n        var res;\n        res = calendar.clickButtonCalendar(query);\n        if (res !== -1) {\n            bot.sendMessage(query.message.chat.id, \"You selected: \" + res);\n        }\n    }\n});\nbot.connect();\n```\n\n### grammY\n\n#### CommonJS\n```js\nconst TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';\n\nconst { Bot } = require('grammy');\nconst Calendar = require('telegram-inline-calendar');\nconst bot = new Bot(TOKEN);\nconst calendar = new Calendar(bot, {\n    date_format: 'DD-MM-YYYY',\n    language: 'en',\n    bot_api: 'grammy'\n});\n\nbot.command('start', ctx =\u003e calendar.startNavCalendar(ctx.msg))\n\nbot.on(\"callback_query:data\", async (ctx) =\u003e {\n    if (ctx.msg.message_id === calendar.chats.get(ctx.chat.id)) {\n        res = calendar.clickButtonCalendar(ctx.callbackQuery);\n        if (res !== -1) {\n            await ctx.reply(\"You selected: \" + res);\n        }\n    }\n});\nbot.start();\n```\n\n#### ESM\n```js\nconst TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';\n\nimport { Bot } from 'grammy';\nimport {Calendar} from 'telegram-inline-calendar';\nconst bot = new Bot(TOKEN, {polling: true});\nconst calendar = new Calendar(bot, {\n    date_format: 'DD-MM-YYYY',\n    language: 'en',\n    bot_api: 'grammy'\n});\n\nbot.command('start', ctx =\u003e calendar.startNavCalendar(ctx))\n\nbot.on(\"callback_query:data\", (ctx) =\u003e {\n    if (ctx.msg.message_id == calendar.chats.get(ctx.chat.id)) {\n        var res;\n        res = calendar.clickButtonCalendar(ctx);\n        if (res !== -1) {\n            ctx.reply(\"You selected: \" + res);\n        }\n    }\n});\nbot.start();\n```\n\n## ⚙️ Default options\n\n```javascript\n{\n    date_format: 'YYYY-MM-DD',                     //Datetime result format\n    language: 'en',                                //Language (en/es/de/es/fr/it/tr/id/uk/pt-br)\n    bot_api: 'node-telegram-bot-api',              //Telegram bot library\n    close_calendar: true,                          //Close calendar after date selection\n    start_week_day: 0,                             //First day of the week(Sunday - `0`, Monday - `1`, Tuesday - `2` and so on)\n    time_selector_mod: false,                      //Enable time selection after a date is selected.\n    time_range: \"00:00-23:59\",                     //Allowed time range in \"HH:mm-HH:mm\" format\n    time_step: \"30m\",                              //Time step in the format \"\u003cTime step\u003e\u003cm | h\u003e\"\n    start_date: false,                             //Minimum date of the calendar in the format \"YYYY-MM-DD\" or \"YYYY-MM-DD HH:mm\" or \"now\"\n    stop_date: false,                              //Maximum date of the calendar in the format \"YYYY-MM-DD\" or \"YYYY-MM-DD HH:mm\" or \"now\"\n    custom_start_msg: false,                       //Text of the message sent with the calendar/time selector\n    lock_date: false,                              //Enable blocked dates list\n    lock_datetime: false,                          //Enable list of blocked dates and times\n    user_lang_select: false,                       //Ability to select the user's language\n    slip_years: false                              //Number of years to skip (1 \u003c `skip_years` \u003c 10)\n}\n```\n\n## License\n\n**The MIT License (MIT)**\n\nCopyright © 2022-present Dmitry Vyazin","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVDS13%2Ftelegram-inline-calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVDS13%2Ftelegram-inline-calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVDS13%2Ftelegram-inline-calendar/lists"}