Giter VIP home page Giter VIP logo

Comments (6)

VDS13 avatar VDS13 commented on July 28, 2024 1

I understood you.
Today I will try to test and release an update)

from telegram-inline-calendar.

VDS13 avatar VDS13 commented on July 28, 2024

Hello, @MrBouchtaoui!
First of all, thank you, I’m glad that my library was useful to someone)
Did I understand you correctly, you want it to be possible if you select the wrong month, say, to be able to go back to choosing the month?

from telegram-inline-calendar.

MrBouchtaoui avatar MrBouchtaoui commented on July 28, 2024

The problem is that I can press < or > one time and than it stops working.
Example:

Calendar starts with January 2024
I press next > I get February
I press next > it stays at February instead of March
I press previous < it stays at February

So the next > or previous < buttons work once and than stop working.
I use the code in my previous post.
I also declared the calendar like this:

let calendar = new Calendar(bot, {
    date_format: 'DD-MM-YYYY',
    language: 'en',
    bot_api: 'telegraf'
});

I hope you have an idea what might be the problem and how to fix it.

from telegram-inline-calendar.

MrBouchtaoui avatar MrBouchtaoui commented on July 28, 2024

I found the solution after studying your code.

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 { // rewind this step to handle next button action!
                ctx.wizard.cursor--;
        }
}

Maybe you can update your examples with a wizard demo. Anyway, thank you very much for sharing this nice library 👌🏼

from telegram-inline-calendar.

VDS13 avatar VDS13 commented on July 28, 2024

Hello, @MrBouchtaoui!
I apologize for the long response, I’m currently busy with my main work, I’ll test it and release an update in the near future.

from telegram-inline-calendar.

VDS13 avatar VDS13 commented on July 28, 2024

Good afternoon, @MrBouchtaoui!
Sorry for the long response, it was too much work.
Regarding your issue: I tested and carefully studied your comment. The problem occurs due to the use of wizard scene, which is a special case of using the library. A little later I will add a FAQ where I will describe such cases. Thanks for your support and use of the library.

from telegram-inline-calendar.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.