PYTHON 48
Responses.py (Andrzej.Langow.ski) By AndrzejL on 26th June 2024 01:57:03 AM
  1. from random import choice, randint
  2.  
  3.  
  4. def get_response(user_input: str) -> str:
  5.     lowered: str = user_input.lower()
  6.  
  7.     if lowered == '':
  8.         return 'Silent treatment? Really?'
  9.     elif 'hello' in lowered:
  10.         return "Welcome to the channel!"
  11.     elif 'what do we say to the god of death?' in lowered:
  12.         return 'Not today!'
  13.     elif 'kurwa' in lowered:
  14.         return 'OI! Language!'
  15.     elif 'hi' in lowered:
  16.         return 'Welcome to the channel!'
  17.     elif 'bye' in lowered:
  18.         return 'See you later!'
  19.     elif 'roll dice' in lowered:
  20.         return f'You rolled: {randint(1, 6)}'
  21.     else:
  22.         return choice([''])

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.