Skip to content

Commit

Permalink
fix: pick a number
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejgray committed Feb 9, 2024
1 parent 87ec859 commit 1442a0c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions skill_randomness/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A skill for all kinds of chance - make a choice, roll a die, flip a coin, etc."""
from curses.ascii import isalnum
from icepool import Die
from ovos_bus_client.message import Message
from ovos_utils import classproperty
Expand Down Expand Up @@ -44,8 +45,12 @@ def handle_make_a_choice_intent(self, message: Message): # pylint: disable=unus
@intent_handler("pick-a-number.intent")
def handle_pick_a_number(self, message: Message):
"""Pick a number between two numbers."""
lower_bound = message.data.get("lower")
upper_bound = message.data.get("upper")
lower_bound = message.data.get("lower", "")
upper_bound = message.data.get("upper", "")
if not lower_bound.isdigit() or not upper_bound.isdigit():
lower_bound = 1
upper_bound = 10
self.speak_dialog("number-range-not-specified")
if not lower_bound or not upper_bound:
lower_bound = 1
upper_bound = 10
Expand Down

0 comments on commit 1442a0c

Please sign in to comment.