All Projects → gianlucaparadise → telegraf-calendar-telegram

gianlucaparadise / telegraf-calendar-telegram

Licence: Apache-2.0 license
Inline calendar for Telegram bots using Telegraf framework

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to telegraf-calendar-telegram

formatbot1
Make instant view easily and fast, from any article on the internet in the best messenger ever Telegram
Stars: ✭ 127 (+195.35%)
Mutual labels:  telegram-bot, telegraf
Defend-The-Castle
Telegram Bot Game - Defend The Castle
Stars: ✭ 21 (-51.16%)
Mutual labels:  telegram-bot, telegraf
telegram-keyboard
Simple and powerful reply and inline keyboard builder for Telegram Bots
Stars: ✭ 70 (+62.79%)
Mutual labels:  telegram-bot, telegraf
cfworker-middware-telegraf
Make telegraf (a telegram bot framework) useable in Cloudflare Workers
Stars: ✭ 23 (-46.51%)
Mutual labels:  telegram-bot, telegraf
Telegraf
Modern Telegram Bot Framework for Node.js
Stars: ✭ 5,178 (+11941.86%)
Mutual labels:  telegram-bot, telegraf
quizquickanswer-telegram-game-bot
🎮 Funny quiz game for telegram, play with friends on your group!
Stars: ✭ 15 (-65.12%)
Mutual labels:  telegram-bot, telegraf
pastebin-bot
Advanced functional Pastebin Telegram Bot made using better-pastebin and TelegrafJS. This bot will help you to create pastes (Texts) on Pastebin which is a text cloud.
Stars: ✭ 16 (-62.79%)
Mutual labels:  telegram-bot, telegraf
podsearch bot
Telegram bot that searches Podcast in iTunes store.
Stars: ✭ 28 (-34.88%)
Mutual labels:  telegram-bot, telegraf
Nayumi
A cute bot of Telegram.
Stars: ✭ 12 (-72.09%)
Mutual labels:  telegram-bot, telegraf
Telegraf-Test
Telegraf Test - Simple Test ToolKit of Telegram Bots
Stars: ✭ 22 (-48.84%)
Mutual labels:  telegram-bot, telegraf
BooksAndBot
Telegram inline bot. Search for books and share them in a conversation
Stars: ✭ 26 (-39.53%)
Mutual labels:  telegram-bot, telegraf
mqtg-bot
MQTT Client Telegram Bot
Stars: ✭ 67 (+55.81%)
Mutual labels:  telegram-bot
messenger-to-telegram
Connect your Facebook Messenger Account to your Telegram Messenger and Erase the Messenger App
Stars: ✭ 63 (+46.51%)
Mutual labels:  telegram-bot
bot
茶馆群内QQ机器人(小可)
Stars: ✭ 61 (+41.86%)
Mutual labels:  telegram-bot
grammy-inline-menu
Inline Menus for Telegram made simple. Successor of telegraf-inline-menu.
Stars: ✭ 274 (+537.21%)
Mutual labels:  telegram-bot
PglRobot
No description or website provided.
Stars: ✭ 12 (-72.09%)
Mutual labels:  telegram-bot
Cloud-UPManager-Bot
Telegram Cloud Upload Manager Bot by @AbirHasan2005
Stars: ✭ 46 (+6.98%)
Mutual labels:  telegram-bot
tellerbot
Telegram Bot for over-the-counter trading
Stars: ✭ 17 (-60.47%)
Mutual labels:  telegram-bot
telegram-bot-api-worker
Take an alternate route to Telegram Bot API :)
Stars: ✭ 75 (+74.42%)
Mutual labels:  telegram-bot
CTBot
A simple (and easy to use) Arduino Telegram BOT Library for ESP8266/ESP32
Stars: ✭ 114 (+165.12%)
Mutual labels:  telegram-bot

telegraf-calendar-telegram

Inline calendar for Telegram bots using Telegraf framework. You can test it using this bot.

Description

Using this simple inline calendar you can allow your Telegram bot to ask dates. This library is built using Telegraf Framework.

Demo

Usage

Installation

npm i telegraf-calendar-telegram --save

Basic usage

// create the bot
const bot = new Telegraf(process.env.CALENDAR_BOT_TOKEN);
// instantiate the calendar
const calendar = new Calendar(bot);

// listen for the selected date event
calendar.setDateListener((context, date) => context.reply(date));
// retreive the calendar HTML
bot.command("calendar", context => context.reply("Here you are", calendar.getCalendar()));

This creates a calendar with the default options: you will have an english calendar with Sunday as starting week day.

Customization

When you instantiate the calendar, you can pass an option object:

const calendar = new Calendar(bot, {
	startWeekDay: 1,
	weekDayNames: ["L", "M", "M", "G", "V", "S", "D"],
	monthNames: [
		"Gen", "Feb", "Mar", "Apr", "Mag", "Giu",
		"Lug", "Ago", "Set", "Ott", "Nov", "Dic"
	]
});

This creates an italian calendar.

Default options:

{
	startWeekDay: 0,
	weekDayNames: ["S", "M", "T", "W", "T", "F", "S"],
	monthNames: [
		"Jan", "Feb", "Mar", "Apr", "May", "Jun",
		"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
	],
	minDate: null,
	maxDate: null
}

The options object has the following properties:

  • startWeekDay: first day of the week, where 0 is Sunday
  • weekDayNames: week day names, where the first element is startWeekDay name
  • monthNames: month names
  • minDate: minimum selectable date (there is a setter on Calendar object, too)
  • maxDate: maximum selectable date (there is a setter on Calendar object, too)

Example

You can find here the code for a working bot.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].