1.0.7 • Published 2 years ago

telegraf-time-picker v1.0.7

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

telegraf-time-picker

Inline time picker for Telegram bots using Telegraf framework.

Description

Using this simple inline time picker you can select the time by clicking. This library is built using Telegraf framework.

Usage

Installation

npm i telegraf-time-picker --save

Basic usage

const bot = new Telegraf(process.env.BOT_TOKEN);

// instantiate the time picker
const timePicker = new TimePicker(bot);

// pass the callback to setTimePickerListener()
timePicker.setTimePickerListener((context, time) => context.reply(time));

// retreive the time picker interface
bot.command('timepicker', (context) => {
    context.reply('Choose the hour:', timePicker.getTimePicker('0'));
});

Example

You can reference here, a simple working bot.

Demo

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago