Skip to content

Botapi 9.4#2553

Merged
Badiboy merged 12 commits intoeternnoir:masterfrom
coder2020official:botapi-94
Feb 14, 2026
Merged

Botapi 9.4#2553
Badiboy merged 12 commits intoeternnoir:masterfrom
coder2020official:botapi-94

Conversation

@coder2020official
Copy link
Collaborator

@coder2020official coder2020official commented Feb 10, 2026

February 9, 2026
Bot API 9.4

  • Allowed bots to use custom emoji in messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
  • Allowed bots to create topics in private chats using the method createForumTopic.
  • Allowed bots to prevent users from creating and deleting topics in private chats through a new setting in the @BotFather Mini App.
  • Added the field allows_users_to_create_topics to the class User.
  • Added the field icon_custom_emoji_id to the classes KeyboardButton and InlineKeyboardButton, allowing bots to show a custom emoji on buttons if they are able to use custom emoji in the message.
  • Added the field style to the classes KeyboardButton and InlineKeyboardButton, allowing bots to change the color of buttons.
  • Added the class ChatOwnerLeft and the field chat_owner_left to the class Message.
  • Added the class ChatOwnerChanged and the field chat_owner_changed to the class Message.
  • Added the methods setMyProfilePhoto and removeMyProfilePhoto, allowing bots to manage their profile picture.
  • Added the class VideoQuality and the field qualities to the class Video allowing bots to get information about other available qualities of a video.
  • Added the field first_profile_audio to the class ChatFullInfo.
  • Added the class UserProfileAudios and the method getUserProfileAudios, allowing bots to fetch a list of audios added to the profile of a user.
  • Added the field rarity to the class UniqueGiftModel.
  • Added the field is_burned to the class UniqueGift.

…d InlineKeyboardButton, allowing bots to show a custom emoji on buttons if they are able to use custom emoji in the message.
…dButton, allowing bots to change the color of buttons.
…ass Message. Added the class ChatOwnerChanged and the field chat_owner_changed to the class Message.
…eo allowing bots to get information about other available qualities of a video.
…, allowing bots to fetch a list of audios added to the profile of a user.
@coder2020official
Copy link
Collaborator Author

@Badiboy need your review, done

Telegram documentation: https://core.telegram.org/bots/api#setmyprofilephoto

:param photo: New profile photo for the bot, uploaded using multipart/form-data
:type photo: :obj:`typing.Union[file_like, str]`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameter photo is of tye InputProfilePhoto.

Image

It's close to just uploading file, but have also type static / animated. So we should either add type[str] (looks incorrect) or change parameter type to InputProfilePhoto (looks coorect).

def set_my_profile_photo(token, photo):
method_url = r'setMyProfilePhoto'
files = None
payload = {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    photo_json, files = photo.convert_input_profile_photo()
    payload['photo'] = photo_json

return types.BotShortDescription.de_json(
apihelper.get_my_short_description(self.token, language_code=language_code))

def set_my_profile_photo(self, photo: Any) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

photo: InputProfilePhoto

result = await asyncio_helper.get_my_name(self.token, language_code)
return types.BotName.de_json(result)

async def set_my_profile_photo(self, photo: Any) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

photo: InputProfilePhoto

Telegram documentation: https://core.telegram.org/bots/api#setmyprofilephoto

:param photo: InputProfilePhoto: The new profile photo to set
:type photo: :obj:`typing.Union[file_like, str]`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:type is wrong

async def set_my_profile_photo(token, photo):
method_url = r'setMyProfilePhoto'
payload = {}
files = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    photo_json, files = photo.convert_input_profile_photo()
    payload['photo'] = photo_json

:return: If successful, returns a UserProfileAudios object.
:rtype: :class:`telebot.types.UserProfileAudios`
"""
return types.UserProfileAudios.de_json(await asyncio_helper.get_user_profile_audios(self.token, user_id, offset, limit))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to pass optional params as named.

@Badiboy
Copy link
Collaborator

Badiboy commented Feb 14, 2026

Additionally, description of createForumTopic method had changed (added "private").

@coder2020official
Copy link
Collaborator Author

Done

@Badiboy
Copy link
Collaborator

Badiboy commented Feb 14, 2026

Thanks, bro!

@Badiboy Badiboy merged commit 4b23926 into eternnoir:master Feb 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants