mirror of https://gitlab.com/litecord/litecord.git
run.py: only pass app instance to PresenceManager
- presence: only receive app when instantiating
This commit is contained in:
parent
6ee5b2fa15
commit
d95b6adb16
|
|
@ -78,11 +78,11 @@ async def _pres(storage, user_id: int, status_obj: dict) -> dict:
|
||||||
|
|
||||||
class PresenceManager:
|
class PresenceManager:
|
||||||
"""Presence related functions."""
|
"""Presence related functions."""
|
||||||
def __init__(self, storage, user_storage, state_manager, dispatcher):
|
def __init__(self, app):
|
||||||
self.storage = storage
|
self.storage = app.storage
|
||||||
self.user_storage = user_storage
|
self.user_storage = app.user_storage
|
||||||
self.state_manager = state_manager
|
self.state_manager = app.state_manager
|
||||||
self.dispatcher = dispatcher
|
self.dispatcher = app.dispatcher
|
||||||
|
|
||||||
async def guild_presences(self, member_ids: List[int],
|
async def guild_presences(self, member_ids: List[int],
|
||||||
guild_id: int) -> List[Dict[Any, str]]:
|
guild_id: int) -> List[Dict[Any, str]]:
|
||||||
|
|
|
||||||
7
run.py
7
run.py
|
|
@ -227,12 +227,7 @@ def init_app_managers(app_):
|
||||||
app_.icons = IconManager(app)
|
app_.icons = IconManager(app)
|
||||||
|
|
||||||
app_.dispatcher = EventDispatcher(app)
|
app_.dispatcher = EventDispatcher(app)
|
||||||
|
app_.presence = PresenceManager(app_)
|
||||||
# TODO: only pass app
|
|
||||||
app_.presence = PresenceManager(
|
|
||||||
app.storage, app.user_storage,
|
|
||||||
app.state_manager, app.dispatcher
|
|
||||||
)
|
|
||||||
|
|
||||||
app_.storage.presence = app.presence
|
app_.storage.presence = app.presence
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue