Created
June 10, 2021 15:22
-
-
Save sayon-bitquery/fd3d2dc180ce0f346d84f0df5b6027fe to your computer and use it in GitHub Desktop.
Telegram Bot function which communicate with the user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def greeting(message): | |
request = message.text.split() | |
if len(request) < 2 and request[0].lower() in "hello" or request[0].lower() in "hi" or request[0].lower() in "hey": | |
return True | |
else: | |
return False | |
def updated_price(message): | |
request = message.text.split() | |
if len(request) == 2 and request[0].lower() in "get" and request[1].lower() in "price": | |
return True | |
else: | |
return False | |
def thanks(message): | |
request = message.text.split() | |
if len(request) <= 4 and request[0].lower() in "thanks" or request[0].lower() in "thnx" or request[0].lower() in "thank": | |
return True | |
else: | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment