vds13 / telegram-inline-calendar Goto Github PK
View Code? Open in Web Editor NEWDate and time picker and Inline calendar for Node.js telegram bots
License: MIT License
Date and time picker and Inline calendar for Node.js telegram bots
License: MIT License
So when I press the advance button to go to the next month nothing happens. it loads for a bit but neither the month nor the days change. And when i press it again, the bot simply crashes. Here is the error log:
Also when I press the go back button it changes to january and skips february. And the it gets stuck on january and it cant advance back to march.
When I call
result = session.calendar.clickButtonCalendar(callbackQuery)
to get the time from callbackQuery
I receive the wrong time when selecting it from the range 00:00-00:59. For example, I choose 00:15 and result = 'YYYY-MM-DD 12:15' but definitely must be 'YYYY-MM-DD 00:15'. Am I doing something wrong?
Can you tell me if it is possible to make the calendar appear without a specific date and time? And is it possible to make start_date together with time?
Hello, all options give errors. How to solve the problem?
ReferenceError: require is not defined in ES module scope, you can use import instead
SyntaxError: Named export 'NavCalendar' not found. The requested module 'telegram-inline-calendar' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:
import pkg from 'telegram-inline-calendar';
const { NavCalendar } = pkg;
[class Calendar]
TypeError: NavCalendar is not a constructor
[Module: null prototype] { default: [class Calendar] }
TypeError: NavCalendar is not a constructor
Is there a way to change the message to other than please select a date?
I can't import 'telegram-inline-calendar' to my project properly as could not find a declaration file for module 'telegram-inline-calendar' . Tried both CommonJS and imports versions, also tried to declare module myself but it sisn't help
First i want to thank you for your fantastic calendar 🎉
I do have a problem, I just think I don't know how to do it correctly.
I can see the callendar on the chat, but I can change month or year just once and than it stops.
I have the following Wizard scene:
const reminderWizard = (userId) => {
return new WizardScene(
"my-wizard",
async (ctx) => {
await ctx.reply(`What's your name?`);
ctx.wizard.cursor = 0;
return ctx.wizard.next();
},
async (ctx) => {
const resp = ctx.message.text;
ctx.scene.session.state.subject = resp;
await ctx.reply(`What's your job?`);
return ctx.wizard.next();
},
async (ctx) => {
const resp = ctx.message.text;
ctx.scene.session.state.description = resp;
console.log("Received response: ", resp);
// show calendar!!!
calendar.startNavCalendar(ctx.message);
return ctx.wizard.next();
},
async (ctx) => {
const resp = ctx.message.text;
console.log("Received response: ", resp);
// Hmmm how does this work???
if (
ctx.callbackQuery.message.message_id ==
calendar.chats.get(ctx.callbackQuery.message.chat.id)
) {
res = calendar.clickButtonCalendar(ctx.callbackQuery);
if (res !== -1) {
await ctx.reply("You selected: " + res);
}
} else {
await ctx.reply(`Thank you for your payment!`);
}
return ctx.wizard.next();
},
async (ctx) => {
const resp = ctx.message;
console.log("Received response: ", resp);
await ctx.reply("I registered your subscription");
return await ctx.scene.leave();
}
);
};
My assumption is that this snippet is not enough:
if (
ctx.callbackQuery.message.message_id ==
calendar.chats.get(ctx.callbackQuery.message.chat.id)
) {
res = calendar.clickButtonCalendar(ctx.callbackQuery);
if (res !== -1) {
await ctx.reply("You selected: " + res);
}
}
Can you please help me with a solution?
Использую TS. который настроен на использование модулей ECMAScript. Как исправить?
Hi there! Got this error while entering /start command
Unhandled rejection Error: TELEGRAM: 400 Bad Request: BUTTON DATA_INVALID
Could you please provide some info - is the cause of this issue and how it can be solved?
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.