Skip to content

Commit

Permalink
style: add type hints for groups variables (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
Era-Dorta authored Feb 8, 2025
1 parent 4c77581 commit 167b49b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion signalbot/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ async def stop_typing(self, receiver: str):
):
raise StopTypingError

async def get_groups(self):
async def get_groups(self) -> list[dict[str, Any]]:
uri = self._groups_uri()
try:
async with aiohttp.ClientSession() as session:
Expand Down
6 changes: 3 additions & 3 deletions signalbot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ async def _detect_groups(self):
# reset group lookups to avoid stale data
self.groups = await self._signal.get_groups()

self._groups_by_id = {}
self._groups_by_internal_id = {}
self._groups_by_name = defaultdict(list)
self._groups_by_id: dict[str, dict[str, Any]] = {}
self._groups_by_internal_id: dict[str, dict[str, Any]] = {}
self._groups_by_name: defaultdict[str, list[dict[str, Any]]] = defaultdict(list)
for group in self.groups:
self._groups_by_id[group["id"]] = group
self._groups_by_internal_id[group["internal_id"]] = group
Expand Down

0 comments on commit 167b49b

Please sign in to comment.