Skip to content

Commit

Permalink
docs: add premium response example
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftinv committed Oct 23, 2023
1 parent 3e6c80c commit 989327a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions disnake/interactions/base.py
Expand Up @@ -1419,6 +1419,17 @@ async def require_premium(self) -> None:
.. versionadded:: 2.10
Example
-------
Require an application subscription for a command: ::
@bot.slash_command()
async def cool_command(inter: disnake.ApplicationCommandInteraction):
if not inter.entitlements:
await inter.response.require_premium()
return # skip remaining code
...
Raises
------
HTTPException
Expand Down

0 comments on commit 989327a

Please sign in to comment.