Skip to content

Commit

Permalink
For the voice message, also include info on the most recent game, if …
Browse files Browse the repository at this point in the history
…available.
  • Loading branch information
johndoknjas committed Jun 2, 2024
1 parent 41f8c4f commit 3b6956b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 4 additions & 2 deletions hypickle/Player.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,11 @@ def print_dict_report(self, report: dict, output_online_status: bool = False) ->
print(f" friended {time_friended}".ljust(20), end='')
print(recent_game_msg, end='')
if output_online_status:
if is_online := self.hypixel_object().isOnline((True,)*3):
Utils.speak(f"{self.name()} is online")
is_online = self.hypixel_object().isOnline((True,)*3)
print(f"this arg player is {'online' if is_online else 'offline'}", end='')
if is_online:
Utils.speak(f"{self.name()} is online" +
(f" and {recent_game_msg}" if recent_game_msg else ''))
if not just_uuids and (updated_json := self.hypixel_object().updated_json) is not None:
print(f" (updated player json obtained {updated_json[1].strftime('%I:%M:%S %p')})", end='')
print()
Expand Down
3 changes: 1 addition & 2 deletions hypickle/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,5 +284,4 @@ def speak(text: str) -> None:
talker.setProperty('volume', 0.2)
talker.setProperty('rate', 160)
talker.say(text)
talker.runAndWait()
sleep(0.5)
talker.runAndWait()
2 changes: 0 additions & 2 deletions ideas.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
- Also once lintception is updated with allowing the user to specify certain files that should
be empty, specify the __init__.py in the hypickle folder.

# If an arg player is online, output a voice message for their most recent game as well.

# If an arg player is online and their recentgames list has a new first dict, voice-output that
they've entered/exited a game since the last check.
# Would have to keep track of the result from the previous call to the recentgames endpoint.
Expand Down

0 comments on commit 3b6956b

Please sign in to comment.