aiogram/docs/api/methods
Alex Root Junior cd4e811856
Refactor: Introduce Union types for streamlined type handling (#1649)
* Refactor: Introduce Union types for streamlined type handling

Implemented Union types across various modules to consolidate and simplify type annotations. This change replaces repetitive union declarations with reusable Union aliases, improving code readability and maintainability. Updates applied to affected classes, methods, and imports accordingly.

* Refactor unions into type aliases for better reusability

Replaced inline `Union` types with predefined aliases like `MediaUnion`, `ReplyMarkupUnion`, and `ChatIdUnion`. Simplifies type annotations, improves code readability, and reduces duplication. Added `media_union.py` for grouping related media types.

* Refactor type unions with ResultChatMemberUnion and ResultMenuButtonUnion

Replaced verbose type definitions of chat member and menu button unions with `ResultChatMemberUnion` and `ResultMenuButtonUnion` for improved readability and maintainability. Updated relevant methods, modules, and documentation to use the new type aliases consistently.

* Added changelog
2025-03-08 02:19:57 +02:00
..
add_sticker_to_set.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
answer_callback_query.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
answer_inline_query.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
answer_pre_checkout_query.rst Added typehints for init methods of types and methods (#1245) 2023-08-04 00:30:27 +03:00
answer_shipping_query.rst Added typehints for init methods of types and methods (#1245) 2023-08-04 00:30:27 +03:00
answer_web_app_query.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
approve_chat_join_request.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
ban_chat_member.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
ban_chat_sender_chat.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
close.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
close_forum_topic.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
close_general_forum_topic.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
copy_message.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
copy_messages.rst Added full support of Bot API 7.11 (#1601) 2024-11-02 16:13:45 +02:00
create_chat_invite_link.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
create_chat_subscription_invite_link.rst Added full support of Bot API 7.9 (#1560) 2024-08-16 00:44:40 +03:00
create_forum_topic.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
create_invoice_link.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
create_new_sticker_set.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
decline_chat_join_request.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
delete_chat_photo.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
delete_chat_sticker_set.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
delete_forum_topic.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
delete_message.rst Update texts 2023-11-24 21:26:33 +02:00
delete_messages.rst Added support for Bot API 7.0 (#1387) 2023-12-31 01:40:44 +02:00
delete_my_commands.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
delete_sticker_from_set.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
delete_sticker_set.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
delete_webhook.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
edit_chat_invite_link.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
edit_chat_subscription_invite_link.rst Added full support of Bot API 7.9 (#1560) 2024-08-16 00:44:40 +03:00
edit_forum_topic.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
edit_general_forum_topic.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
edit_message_caption.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
edit_message_live_location.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
edit_message_media.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
edit_message_reply_markup.rst Added typehints for init methods of types and methods (#1245) 2023-08-04 00:30:27 +03:00
edit_message_text.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
edit_user_star_subscription.rst Added full support for Bot API 8.0 (#1606) 2024-11-17 23:18:42 +02:00
export_chat_invite_link.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
forward_message.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
forward_messages.rst Added full support of Bot API 7.11 (#1601) 2024-11-02 16:13:45 +02:00
get_available_gifts.rst Added full support for Bot API 8.0 (#1606) 2024-11-17 23:18:42 +02:00
get_business_connection.rst Added full support of Bot API 7.2 (#1444) 2024-04-22 13:48:49 +03:00
get_chat.rst Full support of Bot API 7.3 (#1480) 2024-05-06 23:27:54 +03:00
get_chat_administrators.rst Refactor: Introduce Union types for streamlined type handling (#1649) 2025-03-08 02:19:57 +02:00
get_chat_member.rst Refactor: Introduce Union types for streamlined type handling (#1649) 2025-03-08 02:19:57 +02:00
get_chat_member_count.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
get_chat_menu_button.rst Refactor: Introduce Union types for streamlined type handling (#1649) 2025-03-08 02:19:57 +02:00
get_custom_emoji_stickers.rst Added full support of Bot API 7.11 (#1601) 2024-11-02 16:13:45 +02:00
get_file.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
get_forum_topic_icon_stickers.rst Added full support of Bot API 7.11 (#1601) 2024-11-02 16:13:45 +02:00
get_game_high_scores.rst Added full support of Bot API 7.11 (#1601) 2024-11-02 16:13:45 +02:00
get_me.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
get_my_commands.rst Added full support of Bot API 7.11 (#1601) 2024-11-02 16:13:45 +02:00
get_my_default_administrator_rights.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
get_my_description.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
get_my_name.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
get_my_short_description.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
get_star_transactions.rst Added full support of Bot API 7.5 (#1518) 2024-06-19 00:54:22 +03:00
get_sticker_set.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
get_updates.rst Added full support of Bot API 7.11 (#1601) 2024-11-02 16:13:45 +02:00
get_user_chat_boosts.rst Added support for Bot API 7.0 (#1387) 2023-12-31 01:40:44 +02:00
get_user_profile_photos.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
get_webhook_info.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
hide_general_forum_topic.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
index.rst Added full support of Bot API 8.2 (#1623) 2025-01-02 02:38:18 +02:00
leave_chat.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
log_out.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
pin_chat_message.rst Update texts 2023-11-24 21:26:33 +02:00
promote_chat_member.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
refund_star_payment.rst Added full support of Bot API 7.4 (#1498) 2024-05-31 20:07:11 +03:00
remove_chat_verification.rst Added full support of Bot API 8.2 (#1623) 2025-01-02 02:38:18 +02:00
remove_user_verification.rst Added full support of Bot API 8.2 (#1623) 2025-01-02 02:38:18 +02:00
reopen_forum_topic.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
reopen_general_forum_topic.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
replace_sticker_in_set.rst Added full support of Bot API 7.2 (#1444) 2024-04-22 13:48:49 +03:00
restrict_chat_member.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
revoke_chat_invite_link.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
save_prepared_inline_message.rst Added full support for Bot API 8.0 (#1606) 2024-11-17 23:18:42 +02:00
send_animation.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_audio.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_chat_action.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
send_contact.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_dice.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_document.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_game.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_gift.rst Added full support for Bot API 8.0 (#1606) 2024-11-17 23:18:42 +02:00
send_invoice.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_location.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_media_group.rst Added full support of Bot API 7.11 (#1601) 2024-11-02 16:13:45 +02:00
send_message.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_paid_media.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_photo.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_poll.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_sticker.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_venue.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_video.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_video_note.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
send_voice.rst Update newly generated shortcuts to Bot API 7.10 2024-09-08 14:04:43 +03:00
set_chat_administrator_custom_title.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_chat_description.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_chat_menu_button.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_chat_permissions.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_chat_photo.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_chat_sticker_set.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_chat_title.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_custom_emoji_sticker_set_thumbnail.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_game_score.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_message_reaction.rst Added support for Bot API 7.0 (#1387) 2023-12-31 01:40:44 +02:00
set_my_commands.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_my_default_administrator_rights.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_my_description.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_my_name.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_my_short_description.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_passport_data_errors.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_sticker_emoji_list.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_sticker_keywords.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_sticker_mask_position.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_sticker_position_in_set.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_sticker_set_thumbnail.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_sticker_set_title.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
set_user_emoji_status.rst Added full support for Bot API 8.0 (#1606) 2024-11-17 23:18:42 +02:00
set_webhook.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
stop_message_live_location.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
stop_poll.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
unban_chat_member.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
unban_chat_sender_chat.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
unhide_general_forum_topic.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
unpin_all_chat_messages.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
unpin_all_forum_topic_messages.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
unpin_all_general_forum_topic_messages.rst Bot API 6.8 (#1276) 2023-08-18 20:18:05 +03:00
unpin_chat_message.rst Update texts 2023-11-24 21:26:33 +02:00
upload_sticker_file.rst Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
verify_chat.rst Added full support of Bot API 8.2 (#1623) 2025-01-02 02:38:18 +02:00
verify_user.rst Added full support of Bot API 8.2 (#1623) 2025-01-02 02:38:18 +02:00