Skip to content

Commit

Permalink
add more debugging and also make check_pings more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
itsthejoker committed Aug 19, 2022
1 parent 2c979d7 commit 0910bf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bubbles/commands/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ def debug(payload: dict) -> None:
transcription_check_ping_callback()


PLUGIN = Plugin(callable=debug, regex=r"^debug", ignore_prefix=True)
PLUGIN = Plugin(callable=debug, regex=r"^debug")
7 changes: 5 additions & 2 deletions bubbles/commands/periodic/transcription_check_ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ def _get_check_username(message: Dict) -> Optional[str]:
:returns: The username, or None if it couldn't be found.
"""
text = _extract_check_text(message)
username_match = USERNAME_REGEX.search(text)
return username_match.group("username") if username_match else None
try:
username_match = USERNAME_REGEX.search(text)
return username_match.group("username") if username_match else None
except TypeError:
print(f"Could not parse username. Value of `text`: {text}")


def _get_check_status(message: Dict) -> Tuple[CheckStatus, Optional[str]]:
Expand Down

0 comments on commit 0910bf9

Please sign in to comment.