@@ -1550,6 +1550,22 @@ async def delete_chat_sticker_set(self, chat_id: Union[int, str]) -> bool:
15501550 result = await asyncio_helper .delete_chat_sticker_set (self .token , chat_id )
15511551 return result
15521552
1553+ async def answer_web_app_query (self , web_app_query_id : str , result : types .InlineQueryResultBase ) -> types .SentWebAppMessage :
1554+ """
1555+ Use this method to set the result of an interaction with a Web App and
1556+ send a corresponding message on behalf of the user to the chat from which
1557+ the query originated.
1558+ On success, a SentWebAppMessage object is returned.
1559+
1560+ Telegram Documentation: https://core.telegram.org/bots/api#answerwebappquery
1561+
1562+ :param web_app_query_id: Unique identifier for the query to be answered
1563+ :param result: A JSON-serialized object describing the message to be sent
1564+ :return:
1565+ """
1566+
1567+ return await asyncio_helper .answer_web_app_query (self .token , web_app_query_id , result )
1568+
15531569 async def get_chat_member (self , chat_id : Union [int , str ], user_id : int ) -> types .ChatMember :
15541570 """
15551571 Use this method to get information about a member of a chat. Returns a ChatMember object on success.
@@ -2374,6 +2390,7 @@ async def promote_chat_member(
23742390 can_promote_members : Optional [bool ]= None ,
23752391 is_anonymous : Optional [bool ]= None ,
23762392 can_manage_chat : Optional [bool ]= None ,
2393+ can_manage_video_chats : Optional [bool ]= None ,
23772394 can_manage_voice_chats : Optional [bool ]= None ) -> bool :
23782395 """
23792396 Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator
@@ -2400,15 +2417,20 @@ async def promote_chat_member(
24002417 message statistics in channels, see channel members,
24012418 see anonymous administrators in supergroups and ignore slow mode.
24022419 Implied by any other administrator privilege
2403- :param can_manage_voice_chats : Bool: Pass True, if the administrator can manage voice chats
2420+ :param can_manage_video_chats : Bool: Pass True, if the administrator can manage voice chats
24042421 For now, bots can use this privilege only for passing to other administrators.
2422+ :param can_manage_voice_chats: Deprecated, use can_manage_video_chats
24052423 :return: True on success.
24062424 """
2425+
2426+ if can_manage_voice_chats and not can_manage_video_chats is None :
2427+ can_manage_video_chats = can_manage_voice_chats
2428+
24072429 return await asyncio_helper .promote_chat_member (
24082430 self .token , chat_id , user_id , can_change_info , can_post_messages ,
24092431 can_edit_messages , can_delete_messages , can_invite_users ,
24102432 can_restrict_members , can_pin_messages , can_promote_members ,
2411- is_anonymous , can_manage_chat , can_manage_voice_chats )
2433+ is_anonymous , can_manage_chat , can_manage_video_chats )
24122434
24132435 async def set_chat_administrator_custom_title (
24142436 self , chat_id : Union [int , str ], user_id : int , custom_title : str ) -> bool :
@@ -2635,6 +2657,70 @@ async def get_my_commands(self, scope: Optional[types.BotCommandScope],
26352657 result = await asyncio_helper .get_my_commands (self .token , scope , language_code )
26362658 return [types .BotCommand .de_json (cmd ) for cmd in result ]
26372659
2660+ async def set_chat_menu_button (self , chat_id : Union [int , str ]= None ,
2661+ menu_button : types .MenuButton = None ) -> bool :
2662+ """
2663+ Use this method to change the bot's menu button in a private chat,
2664+ or the default menu button.
2665+ Returns True on success.
2666+
2667+ Telegram documentation: https://core.telegram.org/bots/api#setchatmenubutton
2668+
2669+ :param chat_id: Unique identifier for the target private chat.
2670+ If not specified, default bot's menu button will be changed
2671+ :param menu_button: A JSON-serialized object for the new bot's menu button. Defaults to MenuButtonDefault
2672+
2673+ """
2674+ return await asyncio_helper .set_chat_menu_button (self .token , chat_id , menu_button )
2675+
2676+
2677+ async def get_chat_menu_button (self , chat_id : Union [int , str ]= None ) -> types .MenuButton :
2678+ """
2679+ Use this method to get the current value of the bot's menu button
2680+ in a private chat, or the default menu button.
2681+ Returns MenuButton on success.
2682+
2683+ Telegram Documentation: https://core.telegram.org/bots/api#getchatmenubutton
2684+
2685+ :param chat_id: Unique identifier for the target private chat.
2686+ If not specified, default bot's menu button will be returned
2687+ :return: types.MenuButton
2688+
2689+ """
2690+ return types .MenuButton .de_json (await asyncio_helper .get_chat_menu_button (self .token , chat_id ))
2691+
2692+
2693+ async def set_my_default_administrator_rights (self , rights : types .ChatAdministratorRights = None ,
2694+ for_channels : bool = None ) -> bool :
2695+ """
2696+ Use this method to change the default administrator rights requested by the bot
2697+ when it's added as an administrator to groups or channels.
2698+ These rights will be suggested to users, but they are are free to modify
2699+ the list before adding the bot.
2700+ Returns True on success.
2701+
2702+ Telegram documentation: https://core.telegram.org/bots/api#setmydefaultadministratorrights
2703+
2704+ :param rights: A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared.
2705+ :param for_channels: Pass True to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed.
2706+ """
2707+
2708+ return await asyncio_helper .set_my_default_administrator_rights (self .token , rights , for_channels )
2709+
2710+
2711+ async def get_my_default_administrator_rights (self , for_channels : bool = None ) -> types .ChatAdministratorRights :
2712+ """
2713+ Use this method to get the current default administrator rights of the bot.
2714+ Returns ChatAdministratorRights on success.
2715+
2716+ Telegram documentation: https://core.telegram.org/bots/api#getmydefaultadministratorrights
2717+
2718+ :param for_channels: Pass True to get the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be returned.
2719+ :return: types.ChatAdministratorRights
2720+ """
2721+
2722+ return types .ChatAdministratorRights .de_json (await asyncio_helper .get_my_default_administrator_rights (self .token , for_channels ))
2723+
26382724 async def set_my_commands (self , commands : List [types .BotCommand ],
26392725 scope : Optional [types .BotCommandScope ]= None ,
26402726 language_code : Optional [str ]= None ) -> bool :
0 commit comments