Skip to content

Commit

Permalink
formatting; debugging why list is None
Browse files Browse the repository at this point in the history
  • Loading branch information
Ereiarrus committed Feb 5, 2024
1 parent 41d7b1c commit 8d9372a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/complements_bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,8 @@ async def listcomplements_h(self, ctx: commands.Context) -> Iterable[str]:
custom_log("entered listcomplements_h() - 5", ComplementsBot.SHOULD_LOG)

if len(custom_complements) > 0:
custom_log("entered listcomplements_h() - 6", ComplementsBot.SHOULD_LOG)
custom_log("entered listcomplements_h() - 6 - ", ComplementsBot.SHOULD_LOG)
custom_log("[" + ",\n".join(msgs) + "]")
return msgs

custom_log("entered listcomplements_h() - 7", ComplementsBot.SHOULD_LOG)
Expand Down
23 changes: 17 additions & 6 deletions src/complements_bot/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,9 +795,15 @@ async def set_should_ignore_bots(should_ignore_bots: bool, username: Optional[st
await _event_loop.run_in_executor(None, _USERS_DB_REF.child(userid).child(_SHOULD_IGNORE_BOTS).set, should_ignore_bots)


async def set_username(new_username: str, username: Optional[str] = None, userid: Optional[str] = None,
name_to_id: Optional[Union[Callable[[str], Optional[str]], Callable[
[str], Awaitable[Optional[str]]]]] = None) -> None:
async def set_username(
new_username: str,
username: Optional[str] = None,
userid: Optional[str] = None,
name_to_id: Optional[Union[
Callable[[str], Optional[str]],
Callable[[str], Awaitable[Optional[str]]]
]] = None
) -> None:
"""
At least one of 'username' or 'userid' must be specified, and if userid is not specified, name_to_id must be
specified; userid is preferred whenever possible due to being guaranteed to never change
Expand All @@ -816,9 +822,14 @@ async def set_username(new_username: str, username: Optional[str] = None, userid
await _event_loop.run_in_executor(None, _USERS_DB_REF.child(userid).child(_USERNAME).set, new_username)


async def get_username(username: Optional[str] = None, userid: Optional[str] = None,
name_to_id: Optional[Union[Callable[[str], Optional[str]], Callable[
[str], Awaitable[Optional[str]]]]] = None) -> Optional[str]:
async def get_username(
username: Optional[str] = None,
userid: Optional[str] = None,
name_to_id: Optional[Union[
Callable[[str], Optional[str]],
Callable[[str], Awaitable[Optional[str]]]
]] = None
) -> Optional[str]:
"""
:param username:
:param userid:
Expand Down

0 comments on commit 8d9372a

Please sign in to comment.