mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 09:26:10 +00:00
Move MissingApplicationID to top-level discord namespace
This commit is contained in:
@ -47,6 +47,12 @@ __all__ = (
|
||||
'ConnectionClosed',
|
||||
'PrivilegedIntentsRequired',
|
||||
'InteractionResponded',
|
||||
'MissingApplicationID',
|
||||
)
|
||||
|
||||
APP_ID_NOT_FOUND = (
|
||||
'Client does not have an application_id set. Either the function was called before on_ready '
|
||||
'was called or application_id was not passed to the Client constructor.'
|
||||
)
|
||||
|
||||
|
||||
@ -278,3 +284,22 @@ class InteractionResponded(ClientException):
|
||||
def __init__(self, interaction: Interaction):
|
||||
self.interaction: Interaction = interaction
|
||||
super().__init__('This interaction has already been responded to before')
|
||||
|
||||
|
||||
class MissingApplicationID(ClientException):
|
||||
"""An exception raised when the client does not have an application ID set.
|
||||
|
||||
An application ID is required for syncing application commands and various
|
||||
other application tasks such as SKUs or application emojis.
|
||||
|
||||
This inherits from :exc:`~discord.app_commands.AppCommandError`
|
||||
and :class:`~discord.ClientException`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
.. versionchanged:: 2.5
|
||||
This is now exported to the ``discord`` namespace and now inherits from :class:`~discord.ClientException`.
|
||||
"""
|
||||
|
||||
def __init__(self, message: Optional[str] = None):
|
||||
super().__init__(message or APP_ID_NOT_FOUND)
|
||||
|
Reference in New Issue
Block a user