Add ButtonStyle.premium

This commit is contained in:
DA344
2024-06-01 09:48:50 +02:00
committed by GitHub
parent 51142743bc
commit 356474ffb9
6 changed files with 52 additions and 34 deletions

View File

@ -1050,38 +1050,6 @@ class InteractionResponse(Generic[ClientT]):
self._parent._state.store_view(modal)
self._response_type = InteractionResponseType.modal
async def require_premium(self) -> None:
"""|coro|
Sends a message to the user prompting them that a premium purchase is required for this interaction.
This type of response is only available for applications that have a premium SKU set up.
Raises
-------
HTTPException
Sending the response failed.
InteractionResponded
This interaction has already been responded to before.
"""
if self._response_type:
raise InteractionResponded(self._parent)
parent = self._parent
adapter = async_context.get()
http = parent._state.http
params = interaction_response_params(InteractionResponseType.premium_required.value)
await adapter.create_interaction_response(
parent.id,
parent.token,
session=parent._session,
proxy=http.proxy,
proxy_auth=http.proxy_auth,
params=params,
)
self._response_type = InteractionResponseType.premium_required
async def autocomplete(self, choices: Sequence[Choice[ChoiceT]]) -> None:
"""|coro|