Commit graph

55 commits

Author SHA1 Message Date
Jacob Bom
e367b8519d Use explicit kwargs for all class inits in pure api.
While not stickily necessary for most classes (since user isn't directly creating them) it still unifies our approach.
However for some like ReplyKeyboardHide where users are making the classes themselves it should improve IDE autocomplete support.
2016-10-16 16:24:13 +02:00
Jannes Höke
e1242b3b4a message.py: add quote keyword argument to reply_x methods (#420) 2016-09-23 17:44:09 +02:00
Jannes Höke
5116a77221 Class methods (#362)
* bot.py: add create_references method

* create bot reference in webhook handler, use create_references on new updates

* message.py: implement reply_text

* echobot2.py: use Message.reply_text

* fix create_references in webhook handler

* add some more instance methods

* Chat.kick_member and unban_member

* bot.py: Create bot references in outgoing messages

* add tests for everything testable

* test_updater.py: add create_references method to MockBot

* remove Bot.create_references and refactor TelegramObject.de_json to take the additional parameter bot

* List bot as named kwarg where used

* file.py: Use Bot.request property instead of Bot._request attr
2016-09-20 06:36:55 +02:00
Jacob Bom
6647ae3c25 Add methods to parse entities in Message
Should close #400.

* Add parse_entity

* Add parse_entities

* Add MessageEntity types as constants to MessageEntity.

* Add MAX_MESSAGE_ENTITIES to constants.py
Note: the value has been found by experimentation as opposed to extracted from the api docs.

* Add tests for parse_entity and parse_entities
2016-09-07 08:49:09 +02:00
Leandro Toledo
68b5562c49 Add edit_date to Message #302 2016-05-23 20:28:36 -03:00
Leandro Toledo
49122d6a99 Remove \ from base code #259 2016-05-14 23:26:56 -03:00
Leandro Toledo
d445d35ceb Running yapf for codebase #259 2016-05-14 22:46:40 -03:00
Jannes Höke
fdc3ac0cc5 copy paste mishap 2016-05-11 23:37:46 +02:00
Jannes Höke
d881fa6a5f add forward_from_chat field to message 2016-05-11 23:22:05 +02:00
Leandro Toledo
b444cd7bce Adding new modules to docs #232 2016-04-22 11:07:44 -03:00
Jannes Höke
7913d09295 fix message.to_dict 2016-04-18 21:35:39 +02:00
Jannes Höke
c9bfa71ff9 decode new message fields 2016-04-17 12:43:34 +02:00
Leandro Toledo
68dca31f15 Renamed fields new_chat_participant and left_chat_participant #232 2016-04-12 00:33:42 -03:00
Jannes Höke
45a4689fd0 update docstrings of Message regarding supergroup conversion 2016-03-14 09:54:33 +01:00
leandrotoledo
dfc75cc64e Add docstring style checker and fixing some 2016-01-13 14:09:35 -02:00
Jannes Höke
aa8966832b release 3.2 and update copyright notice to 2015-2016 2016-01-05 14:12:03 +01:00
Jannes Höke
ea7c54ba07 Release v3.1.1, change author email everywhere 2015-12-21 21:18:53 +01:00
Jannes Höke
9e7314134e fix docstring 2015-12-17 14:55:20 +01:00
Jannes Höke
6e158042e1 API updates Oct and Nov 2015-12-16 15:31:02 +01:00
Jannes Höke
89015e5ecc fix for sending into a channel 2015-11-03 13:46:23 +01:00
Jannes Höke
d3bea4c3b4 make user_from optional, because of channels 2015-11-03 10:28:06 +01:00
mattijn
69aa1c252b added an easier way to get frequent commands from message. 2015-09-07 04:55:00 +02:00
Leandro Toledo
a86fc6c2ac Improving the design of existing Telegram classes 2015-08-28 17:45:44 -03:00
leandrotoledo
fdb5f2339c Improving the design of existing Telegram classes and adding docstrings 2015-08-21 23:15:29 -03:00
leandrotoledo
d03a394075 Refactoring, improving the design of existing message class and adding docstrings 2015-08-21 14:49:07 -03:00
leandrotoledo
32dc05ed36 Fix lines too long 2015-08-19 16:08:03 -03:00
leandrotoledo
ba5902c1d4 Fix serialization when message has reply_to_message, new_chat_participant or new_chat_photo #42 2015-08-19 15:41:09 -03:00
Leandro Toledo
6e2881b31b Adding support for Voice object and sendVoice method #39 2015-08-17 11:34:42 -03:00
Leandro Toledo
56f6845969 Adding is_json tests and fixes json serialization when a forwared message #38 2015-08-17 09:56:51 -03:00
Leandro Toledo
9b6ccaf94b Convert unix timestamp from date and forward_date in messages to date object #35 2015-08-14 15:47:31 -03:00
Leandro Toledo
ecdf32b5f6 Apply new Telegram Bot API changes #32 2015-08-11 17:32:06 -03:00
Leandro Toledo
163b27b7dd fix license header 2015-08-11 16:58:17 -03:00
Leandro Toledo
6b714bc805 Empty text message return empty string instead None #30 2015-08-11 10:48:29 -03:00
Leandro Toledo
59b247af94 Moving from GPLv2 to LGPLv3 2015-08-10 13:57:31 -03:00
leandrotoledo
b6fb2bc6bf Merge branch 'master' of https://github.com/leandrotoledo/python-telegram-bot into testing 2015-07-20 08:26:29 -03:00
leandrotoledo
61530aeb34 Adding logging decorator 2015-07-20 08:25:04 -03:00
leandrotoledo
f4ad7037e1 Fixes #12 and changes to_data to to_dict 2015-07-19 23:25:44 -03:00
leandrotoledo
859f04e566 Resolves #45 creating to_data abstractmethod on TelegramObject (new base class) 2015-07-19 23:06:04 -03:00
Leandro Toledo
ded002a0c8 Adding newline at EOF 2015-07-19 22:06:07 -03:00
JASON0916
ce852de9a8 base class for telegram class 2015-07-17 22:53:54 +08:00
leandrotoledo
92c3f48cda Removing redundant parentheses, Python3 support, user.name property 2015-07-15 10:05:31 -03:00
Leandro Toledo
649fbc40c8 Encode to UTF8 text messages 2015-07-12 10:30:35 -03:00
Leandro Toledo
59d55df99e Fixes crash when username is not defined on chat 2015-07-11 10:01:07 -03:00
Alex Root
164d6d2942 user without username
fix library crash when connect user without username
2015-07-11 09:57:27 +03:00
Leandro Toledo
b90b608fb1 Add to_json method to classes 2015-07-09 11:40:44 -03:00
Leandro Toledo
b2a4d4f5fc PEP8 2015-07-08 21:58:13 -03:00
Leandro Toledo
0214910741 Adding ReplyMarkup, ForceReply, renaming methods and minor fixes 2015-07-08 21:15:46 -03:00
Leandro Toledo
0c7f649f41 Adding Contact model 2015-07-08 10:20:43 -03:00
Leandro Toledo
c20d6465fc Adding sendChatAction, its tests and minor fixes 2015-07-08 09:55:06 -03:00
Leandro Toledo
86c1f68419 Adding sendLocation, its tests and minor fixes 2015-07-08 09:37:25 -03:00