Comments (13)
thank you very much
from telegram-inline-calendar.
Is there a way to change the message to other than please select a date?
Hello, Can you show an example of the result?
from telegram-inline-calendar.
when useing the command calenadr the message that displayes is please select a date. Is it possible to change it?
from telegram-inline-calendar.
const TOKEN = process.env.TELEGRAM_TOKEN || 'YOUR_TELEGRAM_BOT_TOKEN';
const {Telegraf} = require('telegraf');
const NavCalendar = require('telegram-inline-calendar')
const bot = new Telegraf(TOKEN);
const calendar = new NavCalendar(bot, {
date_format: 'DD-MM-YYYY',
language: 'en',
bot_api: 'telegraf'
});
bot.start((ctx) => calendar.startNavCalendar(ctx.message));
bot.on("callback_query", (ctx) => {
if (ctx.callbackQuery.message.message_id == calendar.chats.get(ctx.callbackQuery.message.chat.id)) {
res = calendar.clickButtonCalendar(ctx.callbackQuery);
if (res !== -1) {
bot.telegram.sendMessage(ctx.callbackQuery.message.chat.id, `Your custom message with date(${res})`);
}
}
});
bot.launch();
process.once('SIGINT', () => bot.stop('SIGINT'));
process.once('SIGTERM', () => bot.stop('SIGTERM'));
from telegram-inline-calendar.
The clickButtonCalendar
method itself returns the date in the format you choose, and can be further processed as you wish.
Examples:
bot.on("callback_query", (ctx) => {
if (ctx.callbackQuery.message.message_id == calendar.chats.get(ctx.callbackQuery.message.chat.id)) {
res = calendar.clickButtonCalendar(ctx.callbackQuery);
if (res !== -1) {
bot.telegram.sendMessage(ctx.callbackQuery.message.chat.id, `Your custom message with date(${res})`);
}
}
});
bot.on("callback_query", (ctx) => {
if (ctx.callbackQuery.message.message_id == calendar.chats.get(ctx.callbackQuery.message.chat.id)) {
res = calendar.clickButtonCalendar(ctx.callbackQuery);
if (res !== -1) {
console.log(`Your custom message with date(${res})`);
}
}
});
from telegram-inline-calendar.
@AguChaves92,
I was able to help you?
from telegram-inline-calendar.
I don't mean the answer after picking the date, but before.
As I've understood it, the command tha launches the bot is this one right?:
bot.start((ctx) => calendar.startNavCalendar(ctx.message));
the triggers a response with a message and the calendar from the bot. I want to change that message.
from telegram-inline-calendar.
I don't mean the answer after picking the date, but before. As I've understood it, the command tha launches the bot is this one right?:
bot.start((ctx) => calendar.startNavCalendar(ctx.message));
the triggers a response with a message and the calendar from the bot. I want to change that message.
I'm sorry, I misunderstood you.
Tomorrow I will release an update with this functionality.
from telegram-inline-calendar.
@AguChaves92 Released an update, please check.
from telegram-inline-calendar.
I see the custom message now thank you
from telegram-inline-calendar.
@AguChaves92, Can the issue be closed?
from telegram-inline-calendar.
from telegram-inline-calendar.
sry, yes
from telegram-inline-calendar.
Related Issues (11)
- 'Bad Request' Error HOT 4
- Could not find a declaration file for module HOT 18
- Is it possible to not display a specific date and time? HOT 9
- I can't switch months 😞 HOT 6
- Could not find a declaration file for module '../utilites/calendar/Calendar.js'. HOT 6
- Changing days order HOT 1
- Error when trying to move through months HOT 13
- TypeError: NavCalendar is not a constructor HOT 3
- Could not find a declaration file for module 'telegram-inline-calendar'. HOT 16
- Get the wrong time when calling clickButtonCalendar HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telegram-inline-calendar.