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
class _ClientOptions(TypedDict, total=False):
max_messages: int
proxy: str
proxy_auth: aiohttp.BasicAuth
shard_id: int
shard_count: int
max_messages: Optional[int]
proxy: Optional[str]
proxy_auth: Optional[aiohttp.BasicAuth]
shard_id: Optional[int]
shard_count: Optional[int]
application_id: int
member_cache_flags: MemberCacheFlags
chunk_guilds_at_startup: bool
status: Status
activity: BaseActivity
allowed_mentions: AllowedMentions
status: Optional[Status]
activity: Optional[BaseActivity]
allowed_mentions: Optional[AllowedMentions]
heartbeat_timeout: float
guild_ready_timeout: float
assume_unsync_clock: bool
enable_debug_events: bool
enable_raw_presences: bool
http_trace: aiohttp.TraceConfig
max_ratelimit_timeout: float
connector: aiohttp.BaseConnector
max_ratelimit_timeout: Optional[float]
connector: Optional[aiohttp.BaseConnector]
# fmt: off

4
discord/ext/commands/bot.py

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

6
discord/ext/commands/core.py

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

10
discord/ext/commands/help.py

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

Loading…
Cancel
Save