Created
August 30, 2015 06:18
-
-
Save Ara4Sh/a679490e7d34f6b3b65e to your computer and use it in GitHub Desktop.
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
import telegram | |
def main(): | |
bot = telegram.Bot(token="113351444:AAGmDDOkLqvzCESShVAfzwBgLiT1R9UvUK0") | |
lui = bot.getUpdates()[-1].update_id | |
print lui | |
while True: | |
for updates in bot.getUpdates(offset=lui,timeout=10): | |
text = updates.message.text | |
chat_id = updates.message.chat.id | |
update_id = updates.update_id | |
if text == "/Arash": | |
bot.sendMessage(chat_id=chat_id,text="Hello Creator welcome back") | |
lui = update_id + 1 | |
else: | |
bot.sendMessage(chat_id=chat_id,text="Hello Stranger how can i help you?") | |
lui = update_id + 1 | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment