Browse Source

Fix various kwargs not being none-able

pull/10286/head
Soheab_ 4 days ago
parent
commit
0e975367af
  1. 20
      discord/client.py
  2. 4
      discord/ext/commands/bot.py
  3. 6
      discord/ext/commands/core.py
  4. 10
      discord/ext/commands/help.py

20
discord/client.py

@ -124,25 +124,25 @@ if TYPE_CHECKING:
from .flags import MemberCacheFlags from .flags import MemberCacheFlags
class _ClientOptions(TypedDict, total=False): class _ClientOptions(TypedDict, total=False):
max_messages: int max_messages: Optional[int]
proxy: str proxy: Optional[str]
proxy_auth: aiohttp.BasicAuth proxy_auth: Optional[aiohttp.BasicAuth]
shard_id: int shard_id: Optional[int]
shard_count: int shard_count: Optional[int]
application_id: int application_id: int
member_cache_flags: MemberCacheFlags member_cache_flags: MemberCacheFlags
chunk_guilds_at_startup: bool chunk_guilds_at_startup: bool
status: Status status: Optional[Status]
activity: BaseActivity activity: Optional[BaseActivity]
allowed_mentions: AllowedMentions allowed_mentions: Optional[AllowedMentions]
heartbeat_timeout: float heartbeat_timeout: float
guild_ready_timeout: float guild_ready_timeout: float
assume_unsync_clock: bool assume_unsync_clock: bool
enable_debug_events: bool enable_debug_events: bool
enable_raw_presences: bool enable_raw_presences: bool
http_trace: aiohttp.TraceConfig http_trace: aiohttp.TraceConfig
max_ratelimit_timeout: float max_ratelimit_timeout: Optional[float]
connector: aiohttp.BaseConnector connector: Optional[aiohttp.BaseConnector]
# fmt: off # fmt: off

4
discord/ext/commands/bot.py

@ -89,8 +89,8 @@ if TYPE_CHECKING:
PrefixType = Union[_Prefix, _PrefixCallable[BotT]] PrefixType = Union[_Prefix, _PrefixCallable[BotT]]
class _BotOptions(_ClientOptions, total=False): class _BotOptions(_ClientOptions, total=False):
owner_id: int owner_id: Optional[int]
owner_ids: Collection[int] owner_ids: Optional[Collection[int]]
strip_after_prefix: bool strip_after_prefix: bool
case_insensitive: bool case_insensitive: bool

6
discord/ext/commands/core.py

@ -68,9 +68,9 @@ if TYPE_CHECKING:
class _CommandDecoratorKwargs(TypedDict, total=False): class _CommandDecoratorKwargs(TypedDict, total=False):
enabled: bool enabled: bool
help: str help: Optional[str]
brief: str brief: Optional[str]
usage: str usage: Optional[str]
rest_is_raw: bool rest_is_raw: bool
aliases: List[str] aliases: List[str]
description: str description: str

10
discord/ext/commands/help.py

@ -69,13 +69,13 @@ if TYPE_CHECKING:
class _HelpCommandOptions(TypedDict, total=False): class _HelpCommandOptions(TypedDict, total=False):
show_hidden: bool show_hidden: bool
verify_checks: bool verify_checks: Optional[bool]
command_attrs: _CommandKwargs command_attrs: _CommandKwargs
class _BaseHelpCommandOptions(_HelpCommandOptions, total=False): class _BaseHelpCommandOptions(_HelpCommandOptions, total=False):
sort_commands: bool sort_commands: bool
dm_help: bool dm_help: Optional[bool]
dm_help_threshold: int dm_help_threshold: Optional[int]
no_category: str no_category: str
paginator: Paginator paginator: Paginator
commands_heading: str commands_heading: str
@ -1364,8 +1364,8 @@ class MinimalHelpCommand(HelpCommand):
def __init__(self, **options: Unpack[_MinimalHelpCommandOptions]) -> None: def __init__(self, **options: Unpack[_MinimalHelpCommandOptions]) -> None:
self.sort_commands: bool = options.pop('sort_commands', True) self.sort_commands: bool = options.pop('sort_commands', True)
self.commands_heading: str = options.pop('commands_heading', 'Commands') self.commands_heading: str = options.pop('commands_heading', 'Commands')
self.dm_help: bool = options.pop('dm_help', False) self.dm_help: Optional[bool] = options.pop('dm_help', False)
self.dm_help_threshold: int = options.pop('dm_help_threshold', 1000) self.dm_help_threshold: Optional[int] = options.pop('dm_help_threshold', 1000)
self.aliases_heading: str = options.pop('aliases_heading', 'Aliases:') self.aliases_heading: str = options.pop('aliases_heading', 'Aliases:')
self.no_category: str = options.pop('no_category', 'No Category') self.no_category: str = options.pop('no_category', 'No Category')

Loading…
Cancel
Save