mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2026-06-19 23:55:29 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f790c3cb2 | |||
| 30749c3b66 | |||
| 8f0447156b | |||
| df000f8086 | |||
| 3d835527e0 | |||
| 323052a6c9 | |||
| ef4871cce1 | |||
| f355af1d2b | |||
| 121e365348 | |||
| 82f1d18f4b | |||
| 79cdb6cafe | |||
| 49ff02dcf4 | |||
| be23ff5d29 | |||
| 72a7355c2f | |||
| 64cf9ed941 | |||
| bb84113272 |
@@ -0,0 +1,5 @@
|
||||
languages:
|
||||
Python: true
|
||||
exclude_paths:
|
||||
- "telegram/emoji.py"
|
||||
- "tests/*"
|
||||
+20
@@ -1,3 +1,23 @@
|
||||
2015-09-05
|
||||
Released 2.8.2
|
||||
Fix regression on Telegram ReplyMarkup
|
||||
Add certificate to is_inputfile method
|
||||
|
||||
|
||||
2015-09-05
|
||||
Released 2.8.1
|
||||
Fix regression on Telegram objects with thumb properties
|
||||
|
||||
|
||||
2015-09-04
|
||||
Released 2.8
|
||||
TelegramError when chat_id is empty for send* methods
|
||||
setWebhook now supports sending self-signed certificate
|
||||
Huge redesign of existing Telegram classes
|
||||
Added support for PyPy
|
||||
Added docstring for existing classes
|
||||
|
||||
|
||||
2015-08-19
|
||||
Released 2.7.1
|
||||
Fixed JSON serialization for message
|
||||
|
||||
+9
-7
@@ -7,15 +7,15 @@ By `Leandro Toledo <leandrotoledodesouza@gmail.com>`_
|
||||
.. image:: https://img.shields.io/pypi/v/python-telegram-bot.svg
|
||||
:target: https://pypi.python.org/pypi/python-telegram-bot
|
||||
:alt: PyPi Package Version
|
||||
|
||||
|
||||
.. image:: https://img.shields.io/pypi/dm/python-telegram-bot.svg
|
||||
:target: https://pypi.python.org/pypi/python-telegram-bot
|
||||
:alt: PyPi Package Monthly Download
|
||||
|
||||
|
||||
.. image:: https://readthedocs.org/projects/python-telegram-bot/badge/?version=latest
|
||||
:target: https://readthedocs.org/projects/python-telegram-bot/?badge=latest
|
||||
:alt: Documentation Status
|
||||
|
||||
|
||||
.. image:: https://img.shields.io/github/license/leandrotoledo/python-telegram-bot.svg
|
||||
:target: http://www.gnu.org/licenses/lgpl-3.0.html
|
||||
:alt: LGPLv3 License
|
||||
@@ -27,7 +27,7 @@ By `Leandro Toledo <leandrotoledodesouza@gmail.com>`_
|
||||
.. image:: https://codeclimate.com/github/leandrotoledo/python-telegram-bot/badges/gpa.svg
|
||||
:target: https://codeclimate.com/github/leandrotoledo/python-telegram-bot
|
||||
:alt: Code Climate
|
||||
|
||||
|
||||
.. image:: https://coveralls.io/repos/leandrotoledo/python-telegram-bot/badge.svg?branch=master&service=github
|
||||
:target: https://coveralls.io/github/leandrotoledo/python-telegram-bot?branch=master
|
||||
:alt: Coveralls
|
||||
@@ -55,7 +55,7 @@ Table of contents
|
||||
2. `Logging`_
|
||||
|
||||
3. `Examples`_
|
||||
|
||||
|
||||
4. `Documentation`_
|
||||
|
||||
- `License`_
|
||||
@@ -108,6 +108,8 @@ Python Version *Supported?*
|
||||
2.7 Yes
|
||||
3.3 Yes
|
||||
3.4 Yes
|
||||
PyPy Yes
|
||||
PyPy3 Yes
|
||||
============== ============
|
||||
|
||||
=============
|
||||
@@ -262,9 +264,9 @@ You may copy, distribute and modify the software provided that modifications are
|
||||
_`Contact`
|
||||
==========
|
||||
|
||||
Feel free to join to our `Telegram group <https://telegram.me/joinchat/00b9c0f802509b94d52953d3fa1ec504>`_.
|
||||
Feel free to join to our `Telegram group <https://telegram.me/joinchat/00b9c0f802509b946b2e8e98b73e19be>`_.
|
||||
|
||||
*If you face trouble joining in the group please ping me on Telegram (@leandrotoledo), I'll be glad to add you.*
|
||||
If you face trouble joining in the group please ping me `via Telegram <https://telegram.me/leandrotoledo>`_, I'll be glad to add you.
|
||||
|
||||
=======
|
||||
_`TODO`
|
||||
|
||||
+2
-2
@@ -58,9 +58,9 @@ author = u'Leandro Toledo'
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '2.5'
|
||||
version = '2.8'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '2.5.1'
|
||||
release = '2.8.2'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
||||
@@ -15,7 +15,7 @@ def read(*paths):
|
||||
|
||||
setup(
|
||||
name='python-telegram-bot',
|
||||
version='2.7.1',
|
||||
version='2.8.2',
|
||||
author='Leandro Toledo',
|
||||
author_email='leandrotoledodesouza@gmail.com',
|
||||
license='LGPLv3',
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"""A library that provides a Python interface to the Telegram Bot API"""
|
||||
|
||||
__author__ = 'leandrotoledodesouza@gmail.com'
|
||||
__version__ = '2.7.1'
|
||||
__version__ = '2.8.2'
|
||||
|
||||
from .base import TelegramObject
|
||||
from .user import User
|
||||
|
||||
@@ -65,4 +65,6 @@ class Document(TelegramObject):
|
||||
if not data:
|
||||
return None
|
||||
|
||||
data['thumb'] = PhotoSize.de_json(data.get('thumb'))
|
||||
|
||||
return Document(**data)
|
||||
|
||||
@@ -57,4 +57,3 @@ class ForceReply(ReplyMarkup):
|
||||
return None
|
||||
|
||||
return ForceReply(**data)
|
||||
|
||||
|
||||
@@ -171,7 +171,8 @@ class InputFile(object):
|
||||
bool
|
||||
"""
|
||||
if data:
|
||||
file_types = ['audio', 'document', 'photo', 'video', 'voice']
|
||||
file_types = ['audio', 'document', 'photo', 'video', 'voice',
|
||||
'certificate']
|
||||
file_type = [i for i in list(data.keys()) if i in file_types]
|
||||
|
||||
if file_type:
|
||||
|
||||
@@ -27,6 +27,3 @@ class ReplyMarkup(TelegramObject):
|
||||
@staticmethod
|
||||
def de_json(data):
|
||||
pass
|
||||
|
||||
def to_dict(self):
|
||||
pass
|
||||
|
||||
@@ -67,4 +67,6 @@ class Sticker(TelegramObject):
|
||||
if not data:
|
||||
return None
|
||||
|
||||
data['thumb'] = PhotoSize.de_json(data.get('thumb'))
|
||||
|
||||
return Sticker(**data)
|
||||
|
||||
@@ -74,4 +74,6 @@ class Video(TelegramObject):
|
||||
if not data:
|
||||
return None
|
||||
|
||||
data['thumb'] = PhotoSize.de_json(data.get('thumb'))
|
||||
|
||||
return Video(**data)
|
||||
|
||||
@@ -185,6 +185,7 @@ class BotTest(unittest.TestCase):
|
||||
|
||||
self.assertTrue(self.is_json(message.to_json()))
|
||||
self.assertEqual(message.document.file_size, 12948)
|
||||
self.assertTrue(isinstance(message.document.thumb, telegram.PhotoSize))
|
||||
|
||||
def testSendGIFURLDocument(self):
|
||||
'''Test the telegram.Bot sendDocument method'''
|
||||
@@ -203,6 +204,7 @@ class BotTest(unittest.TestCase):
|
||||
|
||||
self.assertTrue(self.is_json(message.to_json()))
|
||||
self.assertEqual(message.document.file_id, 'BQADAQADHAADNTwtBxZxUGKyxYbYAg')
|
||||
self.assertTrue(isinstance(message.document.thumb, telegram.PhotoSize))
|
||||
|
||||
def testSendVideo(self):
|
||||
'''Test the telegram.Bot sendVideo method'''
|
||||
@@ -214,6 +216,8 @@ class BotTest(unittest.TestCase):
|
||||
self.assertTrue(self.is_json(message.to_json()))
|
||||
self.assertEqual(message.video.file_size, 326534)
|
||||
self.assertEqual(message.caption, 'testSendVideo')
|
||||
if message.video.thumb:
|
||||
self.assertTrue(isinstance(message.video.thumb, telegram.PhotoSize))
|
||||
|
||||
def testResendVideo(self):
|
||||
'''Test the telegram.Bot sendVideo method'''
|
||||
@@ -223,6 +227,7 @@ class BotTest(unittest.TestCase):
|
||||
|
||||
self.assertTrue(self.is_json(message.to_json()))
|
||||
self.assertEqual(message.video.duration, 4)
|
||||
self.assertTrue(isinstance(message.video.thumb, telegram.PhotoSize))
|
||||
|
||||
def testResendSticker(self):
|
||||
'''Test the telegram.Bot sendSticker method'''
|
||||
@@ -232,6 +237,7 @@ class BotTest(unittest.TestCase):
|
||||
|
||||
self.assertTrue(self.is_json(message.to_json()))
|
||||
self.assertEqual(message.sticker.file_size, 39518)
|
||||
self.assertTrue(isinstance(message.sticker.thumb, telegram.PhotoSize))
|
||||
|
||||
def testSendLocation(self):
|
||||
'''Test the telegram.Bot sendLocation method'''
|
||||
|
||||
Reference in New Issue
Block a user