Skip to content

Api 9.0 gifts #4763

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

Merged
merged 10 commits into from
Apr 23, 2025
4 changes: 4 additions & 0 deletions changes/unreleased/4756.JT5nmUmGRG6qDEh5ScMn5f.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ closes_threads = []
uid = "4759"
author_uid = "Bibo-Joshi"
closes_threads = []
[[pull_requests]]
uid = "4763"
author_uid = "aelkheir"
closes_threads = []
10 changes: 10 additions & 0 deletions docs/source/inclusions/bot_methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@

* - :meth:`~telegram.Bot.get_business_connection`
- Used for getting information about the business account.
* - :meth:`~telegram.Bot.get_business_account_gifts`
- Used for getting gifts owned by the business account.
* - :meth:`~telegram.Bot.read_business_message`
- Used for marking a message as read.
* - :meth:`~telegram.Bot.delete_business_messages`
Expand All @@ -421,6 +423,14 @@
- Used for setting the business account username.
* - :meth:`~telegram.Bot.set_business_account_bio`
- Used for setting the business account bio.
* - :meth:`~telegram.Bot.set_business_account_gift_settings`
- Used for setting the business account gift settings.
* - :meth:`~telegram.Bot.convert_gift_to_stars`
- Used for converting owned reqular gifts to stars.
* - :meth:`~telegram.Bot.upgrade_gift`
- Used for upgrading owned regular gifts to unique ones.
* - :meth:`~telegram.Bot.transfer_gift`
- Used for transferring owned unique gifts to another user.
Comment on lines +428 to +433
Copy link
Member

Choose a reason for hiding this comment

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

should these go into "payments and stars" above? I guess in the end it doesn't matter much …



.. raw:: html
Expand Down
6 changes: 6 additions & 0 deletions docs/source/telegram.acceptedgifttypes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AcceptedGiftTypes
=================

.. autoclass:: telegram.AcceptedGiftTypes
:members:
:show-inheritance:
12 changes: 12 additions & 0 deletions docs/source/telegram.at-tree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Available Types
.. toctree::
:titlesonly:

telegram.acceptedgifttypes
telegram.animation
telegram.audio
telegram.birthdate
Expand Down Expand Up @@ -76,6 +77,7 @@ Available Types
telegram.forumtopicreopened
telegram.generalforumtopichidden
telegram.generalforumtopicunhidden
telegram.giftinfo
telegram.giveaway
telegram.giveawaycompleted
telegram.giveawaycreated
Expand Down Expand Up @@ -117,6 +119,10 @@ Available Types
telegram.messageoriginuser
telegram.messagereactioncountupdated
telegram.messagereactionupdated
telegram.ownedgift
telegram.ownedgiftregular
telegram.ownedgifts
telegram.ownedgiftunique
telegram.paidmedia
telegram.paidmediainfo
telegram.paidmediaphoto
Expand All @@ -142,6 +148,12 @@ Available Types
telegram.switchinlinequerychosenchat
telegram.telegramobject
telegram.textquote
telegram.uniquegift
telegram.uniquegiftbackdrop
telegram.uniquegiftbackdropcolors
telegram.uniquegiftinfo
telegram.uniquegiftmodel
telegram.uniquegiftsymbol
telegram.update
telegram.user
telegram.userchatboosts
Expand Down
7 changes: 7 additions & 0 deletions docs/source/telegram.giftinfo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
GiftInfo
========

.. autoclass:: telegram.GiftInfo
:members:
:show-inheritance:

6 changes: 6 additions & 0 deletions docs/source/telegram.ownedgift.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OwnedGift
=========

.. autoclass:: telegram.OwnedGift
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.ownedgiftregular.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OwnedGiftRegular
================

.. autoclass:: telegram.OwnedGiftRegular
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.ownedgifts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OwnedGifts
==========

.. autoclass:: telegram.OwnedGifts
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.ownedgiftunique.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OwnedGiftUnique
===============

.. autoclass:: telegram.OwnedGiftUnique
:members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/telegram.uniquegift.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UniqueGift
==========

.. autoclass:: telegram.UniqueGift
:members:
:show-inheritance:

7 changes: 7 additions & 0 deletions docs/source/telegram.uniquegiftbackdrop.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UniqueGiftBackdrop
==================

.. autoclass:: telegram.UniqueGiftBackdrop
:members:
:show-inheritance:

7 changes: 7 additions & 0 deletions docs/source/telegram.uniquegiftbackdropcolors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UniqueGiftBackdropColors
========================

.. autoclass:: telegram.UniqueGiftBackdropColors
:members:
:show-inheritance:

7 changes: 7 additions & 0 deletions docs/source/telegram.uniquegiftinfo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UniqueGiftInfo
==============

.. autoclass:: telegram.UniqueGiftInfo
:members:
:show-inheritance:

7 changes: 7 additions & 0 deletions docs/source/telegram.uniquegiftmodel.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UniqueGiftModel
===============

.. autoclass:: telegram.UniqueGiftModel
:members:
:show-inheritance:

7 changes: 7 additions & 0 deletions docs/source/telegram.uniquegiftsymbol.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UniqueGiftSymbol
================

.. autoclass:: telegram.UniqueGiftSymbol
:members:
:show-inheritance:

23 changes: 22 additions & 1 deletion telegram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

__author__ = "devs@python-telegram-bot.org"
__all__ = (
"AcceptedGiftTypes",
"AffiliateInfo",
"Animation",
"Audio",
Expand Down Expand Up @@ -104,6 +105,7 @@
"GeneralForumTopicHidden",
"GeneralForumTopicUnhidden",
"Gift",
"GiftInfo",
"Gifts",
"Giveaway",
"GiveawayCompleted",
Expand Down Expand Up @@ -181,6 +183,10 @@
"MessageReactionCountUpdated",
"MessageReactionUpdated",
"OrderInfo",
"OwnedGift",
"OwnedGiftRegular",
"OwnedGiftUnique",
"OwnedGifts",
"PaidMedia",
"PaidMediaInfo",
"PaidMediaPhoto",
Expand Down Expand Up @@ -245,6 +251,12 @@
"TransactionPartnerTelegramAds",
"TransactionPartnerTelegramApi",
"TransactionPartnerUser",
"UniqueGift",
"UniqueGiftBackdrop",
"UniqueGiftBackdropColors",
"UniqueGiftInfo",
"UniqueGiftModel",
"UniqueGiftSymbol",
"Update",
"User",
"UserChatBoosts",
Expand Down Expand Up @@ -393,7 +405,7 @@
from ._games.callbackgame import CallbackGame
from ._games.game import Game
from ._games.gamehighscore import GameHighScore
from ._gifts import Gift, Gifts
from ._gifts import AcceptedGiftTypes, Gift, GiftInfo, Gifts
from ._giveaway import Giveaway, GiveawayCompleted, GiveawayCreated, GiveawayWinners
from ._inline.inlinekeyboardbutton import InlineKeyboardButton
from ._inline.inlinekeyboardmarkup import InlineKeyboardMarkup
Expand Down Expand Up @@ -445,6 +457,7 @@
MessageOriginUser,
)
from ._messagereactionupdated import MessageReactionCountUpdated, MessageReactionUpdated
from ._ownedgift import OwnedGift, OwnedGiftRegular, OwnedGifts, OwnedGiftUnique
from ._paidmedia import (
PaidMedia,
PaidMediaInfo,
Expand Down Expand Up @@ -510,6 +523,14 @@
from ._story import Story
from ._switchinlinequerychosenchat import SwitchInlineQueryChosenChat
from ._telegramobject import TelegramObject
from ._uniquegift import (
UniqueGift,
UniqueGiftBackdrop,
UniqueGiftBackdropColors,
UniqueGiftInfo,
UniqueGiftModel,
UniqueGiftSymbol,
)
from ._update import Update
from ._user import User
from ._userprofilephotos import UserProfilePhotos
Expand Down
Loading
Loading