Skip to content

Instantly share code, notes, and snippets.

@Ara4Sh
Created August 30, 2015 06:18
Show Gist options
  • Save Ara4Sh/a679490e7d34f6b3b65e to your computer and use it in GitHub Desktop.
Save Ara4Sh/a679490e7d34f6b3b65e to your computer and use it in GitHub Desktop.
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