Skip to content

Instantly share code, notes, and snippets.

View hoseinmontazer's full-sized avatar
💭
:)

hoseinmontazer hoseinmontazer

💭
:)
View GitHub Profile
import telegram
def main():
bot = telegram.Bot(token="128535145:AAG6gTZYlAjbIeQmy-r3ZtG_pnBpi7hJSAQ")
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
@hoseinmontazer
hoseinmontazer / telegram.bot
Created August 19, 2015 09:42
test-python
import telegram
bot = telegram.Bot(token='94659039:AAGxm7YBCKonO9DYtusYWBnbG1Ve8BjK3iM')
print bot.getMe()
updates = bot.getUpdates()
print [u.message.text for u in updates]
updates = bot.getUpdates()
print [u.message.photo for u in updates if u.message.photo]