mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-20 23:42:58 +00:00
Move MissingApplicationID to top-level discord namespace
This commit is contained in:
@@ -27,7 +27,7 @@ from __future__ import annotations
|
||||
from typing import Any, TYPE_CHECKING, List, Optional, Sequence, Union
|
||||
|
||||
from ..enums import AppCommandOptionType, AppCommandType, Locale
|
||||
from ..errors import DiscordException, HTTPException, _flatten_error_dict
|
||||
from ..errors import DiscordException, HTTPException, _flatten_error_dict, MissingApplicationID as MissingApplicationID
|
||||
from ..utils import _human_join
|
||||
|
||||
__all__ = (
|
||||
@@ -59,11 +59,6 @@ if TYPE_CHECKING:
|
||||
|
||||
CommandTypes = Union[Command[Any, ..., Any], Group, ContextMenu]
|
||||
|
||||
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.'
|
||||
)
|
||||
|
||||
|
||||
class AppCommandError(DiscordException):
|
||||
"""The base exception type for all application command related errors.
|
||||
@@ -422,19 +417,6 @@ class CommandSignatureMismatch(AppCommandError):
|
||||
super().__init__(msg)
|
||||
|
||||
|
||||
class MissingApplicationID(AppCommandError):
|
||||
"""An exception raised when the client does not have an application ID set.
|
||||
An application ID is required for syncing application commands.
|
||||
|
||||
This inherits from :exc:`~discord.app_commands.AppCommandError`.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
"""
|
||||
|
||||
def __init__(self, message: Optional[str] = None):
|
||||
super().__init__(message or APP_ID_NOT_FOUND)
|
||||
|
||||
|
||||
def _get_command_error(
|
||||
index: str,
|
||||
inner: Any,
|
||||
|
Reference in New Issue
Block a user