Skip to content

Instantly share code, notes, and snippets.

@sayon-bitquery
Created June 10, 2021 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayon-bitquery/fd3d2dc180ce0f346d84f0df5b6027fe to your computer and use it in GitHub Desktop.
Save sayon-bitquery/fd3d2dc180ce0f346d84f0df5b6027fe to your computer and use it in GitHub Desktop.
Telegram Bot function which communicate with the user
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