Skip to content

Commit

Permalink
Merge pull request #53 from nekokatt/bugfix/initpy
Browse files Browse the repository at this point in the history
Added missing import to `__init__.py`
  • Loading branch information
Nekokatt authored Aug 20, 2020
2 parents c4ff53e + fbbf195 commit 96f4613
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions hikari/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
from hikari.files import Pathish
from hikari.files import Rawish
from hikari.files import Resourceish
from hikari.guilds import *
from hikari.impl.bot import BotApp as Bot
from hikari.impl.rest import RESTApp as REST
from hikari.intents import *
Expand Down
13 changes: 10 additions & 3 deletions hikari/impl/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ class BotApp(
"_shards",
"_started_at_monotonic",
"_started_at_timestamp",
"_stateless",
"_tasks",
"_token",
"_version",
Expand Down Expand Up @@ -311,6 +312,7 @@ def __init__(
self._guild_chunker: guild_chunker_.GuildChunker
self._event_manager: event_manager_base.EventManagerBase

self._stateless = stateless
if stateless:
self._cache = stateless_cache_impl.StatelessCacheImpl()
self._guild_chunker = stateless_guild_chunker_impl.StatelessGuildChunkerImpl()
Expand Down Expand Up @@ -386,6 +388,11 @@ def http_settings(self) -> config.HTTPSettings:
# <<inherited docstring from traits.NetworkSettingsAware>>
return self._http_settings

@property
def intents(self) -> typing.Optional[intents_.Intents]:
# <<inherited docstring from traits.ShardAware>>
return self._intents

@property
def is_debug_enabled(self) -> bool:
"""Return `builtins.True` if debugging is enabled.
Expand All @@ -399,9 +406,9 @@ def is_debug_enabled(self) -> bool:
return self._debug

@property
def intents(self) -> typing.Optional[intents_.Intents]:
# <<inherited docstring from traits.ShardAware>>
return self._intents
def is_stateless(self) -> bool:
# <<inherited docstring from traits.CacheAware>>
return self._stateless

@property
def me(self) -> typing.Optional[users.OwnUser]:
Expand Down
12 changes: 12 additions & 0 deletions hikari/traits.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@ def cache(self) -> cache_.Cache:
"""
raise NotImplementedError

@property
def is_stateless(self) -> bool:
"""Return `builtins.True` if the cache is stateless.
Returns
-------
builtins.bool
`builtins.True` if the cache is stateless. Otherwise,
`builtins.False`.
"""
raise NotImplementedError


@typing.runtime_checkable
class DispatcherAware(typing.Protocol):
Expand Down

0 comments on commit 96f4613

Please sign in to comment.