Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location widget #322

Open
maksachve opened this issue Sep 11, 2023 · 1 comment
Open

Location widget #322

maksachve opened this issue Sep 11, 2023 · 1 comment
Labels
core Something, that affects core functionality widget New widget request, or some widget fixes

Comments

@maksachve
Copy link

maksachve commented Sep 11, 2023

In the aiogram library, it is possible to send a location and attach an inline keyboard to it.

Example:

builder.row(types.InlineKeyboardButton(
        text="👉 СМОТРЕТЬ 👈", url="https://www.google.com/")
    )
    
    await event.answer_location(latitude="55.737985", longitude="37.623299", reply_markup=builder.as_markup())

The method is not media, so I think it would be wiser, before drawing the window, to delete the old message and in the same way in the reverse order, as now switching between a window with text to a window with media, and in the reverse order.

Screenshot_20230911_135725

@Tishka17 Tishka17 added widget New widget request, or some widget fixes core Something, that affects core functionality labels Oct 5, 2023
@maksachve
Copy link
Author

The send_location and send_venue methods, as it turned out, lack a description, and of course parse_mode. But with these two methods, you can still attach an inline keyboard. I also noticed that send_venue has more flexible settings for the location being sent, I think it would be better to implement this method in a widget rather than in send_location!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Something, that affects core functionality widget New widget request, or some widget fixes
Projects
None yet
Development

No branches or pull requests

2 participants