mobilecoinofficial / forest

Enables a Forest of MobileCoin enabled SignalBots. Beta software, APIs may change!
MIT License
19 stars 12 forks source link

questionbotting / add ask_multiplechoice_question #151

Closed itdaniher closed 2 years ago

itdaniher commented 2 years ago
checker - sees if answer can be converted
converter - converts string to type of answer
clarifier - text added to question if checker fails

ask_multiple_choice ( recipient, question_text: Optional[str], options: Union[dict[str,str], list[str]], requires_confirmation: bool, requires_first_device: bool):

if question_text is None:
    question_text = "Pick one from these options:"
if isinstance(options, dict):
   # labels provided
if isinstance(options, list):
   # generate labels

options = dict[str,str]

prints ie)

"""Please enter one of the following numbers to select a charity to receive your donation:
    1. Ideas Beyond Borders ( https://www.ideasbeyondborders.org/ )
    2. Ukrainian Students for Freedom ( https://standwithukraine.ch/ )"""
{'give': 'Please enter one of the following numbers to select a charity to receive your donation:\n    1. Ideas Beyond Borders ( https://www.ideasbeyondborders.org/ )\n    2. Ukrainian Students for Freedom ( https://standwithukraine.ch/ )', 'gift': "You probably mean 'give'! - updated by ilia_76ae", 'donate': "You probably mean 'give'! - added by ilia_76ae", 'longnow': 'The Long Now Foundation', 'ideasbeyondborders': 'Ideas Beyond Borders (https://www.ideasbeyondborders.org/)', 'fightforthefuture': 'Fight For The Future', '1_give': 'ideasbeyondborders', '2_give': 'standwithukraine', '3_give': 'standwithukraine', 'comebackalive': 'Повернись Живим (Come Back Alive)', 'standwithukraine': 'Ukranian Students for Freedom (https://standwithukraine.ch/)', '1': '"Say \'give\' first please!" - added by ilia_76ae', '2': "Say 'give' first please! - added by ilia_76ae", '3': "Say 'give' first please! - added by ilia_76ae", '4': "Sorry, that's not an option! - added by ilia_76ae"}