Python 2.7.9 (default, Mar 8 2015, 00:52:26)
[GCC 4.9.2] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> import telegram
>>> bot = telegram.Bot(token='123123:My_token')
>>> print(bot.getMe())
{'username': u'My_bot', 'first_name': u'Flexget', 'last_name': '', 'type': '', 'id': 123123}
>>> updates = bot.getUpdates()
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
updates = bot.getUpdates()
File "/usr/local/lib/python2.7/dist-packages/telegram/bot.py", line 109, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/telegram/bot.py", line 1215, in getUpdates
result = request.post(url, data, timeout=urlopen_timeout)
File "/usr/local/lib/python2.7/dist-packages/telegram/utils/request.py", line 83, in decorator
raise NetworkError('URLError: {0}'.format(error.reason))
NetworkError: URLError: [Errno 101] Network is unreachable
>>> chat_id = bot.getUpdates()[-1].message.chat_id
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
chat_id = bot.getUpdates()[-1].message.chat_id
File "/usr/local/lib/python2.7/dist-packages/telegram/bot.py", line 109, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/telegram/bot.py", line 1215, in getUpdates
result = request.post(url, data, timeout=urlopen_timeout)
File "/usr/local/lib/python2.7/dist-packages/telegram/utils/request.py", line 83, in decorator
raise NetworkError('URLError: {0}'.format(error.reason))
NetworkError: URLError: [Errno 101] Network is unreachable
>>>
My network is okay.
My network is okay.