Conversation
Or at least the methods/classes for sending.
Still needs tests though
Missing docstrings for now though, wanna add everything first
Also chat_instance in CallbackQuery which will break a lot of tests probably
N.B. test_send_video_mp4_file_url() is still failing, probably because of telegram servers bug. Will contact telegram bot support about that.
Also, small fix to the description text of ChatMigrated
- fix copy/paste errors - return Message object
* bot.py fix copy paste error in url * callbackquery.py make data field optional * message.py introduce optional game field
small fix for game related parts
Still need setGameScore (I'm thinking we can set it to the ever increasing envvar 'TRAVIS_BUILD_NUMBER') and getGameHighScores. The tests currently don't work... Since I don't really understand how PhotoSize works... Please halp :P
Needs proper animation file_id and size. Also assertEqual can't test if two objects have the same data, so we just check the file_id instead.
telegram/bot.py
Outdated
| @message | ||
| def sendGame(self, | ||
| chat_id, | ||
| game_short_name, |
There was a problem hiding this comment.
According to https://core.telegram.org/bots/api#sendgame the kwargs should be different
telegram/bot.py
Outdated
| data['edit_message'] = edit_message | ||
|
|
||
| result = self._request.post(url, data, timeout=kwargs.get('timeout')) | ||
| return Message.de_json(result, self) |
There was a problem hiding this comment.
result could be just True (https://core.telegram.org/bots/api#setgamescore), won't this raise an error?
telegram/callbackquery.py
Outdated
| self.message = kwargs.get('message') | ||
| self.data = kwargs.get('data', '') | ||
| self.inline_message_id = kwargs.get('inline_message_id', '') | ||
| self.game_short_name = kwargs.get('game_short_name') |
telegram/chat.py
Outdated
| self.username = kwargs.get('username', '') | ||
| self.first_name = kwargs.get('first_name', '') | ||
| self.last_name = kwargs.get('last_name', '') | ||
| self.all_members_are_admins = kwargs.get('all_members_are_admins', '') |
There was a problem hiding this comment.
Should be False as default, not empty string
| data['text_entities'] = [x.to_dict() for x in self.text_entities] | ||
|
|
||
| return data | ||
|
|
There was a problem hiding this comment.
are these just copy-pasted from telegram.Message?
There was a problem hiding this comment.
Yeah, they are. Is there a better way to do it?
telegram/gamehighscore.py
Outdated
| # | ||
| # You should have received a copy of the GNU Lesser Public License | ||
| # along with this program. If not, see [http://www.gnu.org/licenses/]. | ||
| """This module contains a object that represents a Telegram GameHighScore.""" |
There was a problem hiding this comment.
Are you sure... an sounds wrong to me here.. T is a consonant sound, and so is G for that matter so I think it should be a.
I could be wrong though...
There was a problem hiding this comment.
Not meaning to meddle :), but he's most likely talking about "a object", not "a Telegram".
There was a problem hiding this comment.
Ah of cause, sorry, I derped. Will fix shortly :) Thanks :D
EDIT: It seems however that we use "a object" litterally everywhere in the library... @jh0ker, Should I fix this everywhere, leave it for now, or just fix this particular instance?
telegram/game.py
Outdated
| title, | ||
| description, | ||
| photo, | ||
| text=None, |
telegram/webhookinfo.py
Outdated
| self.has_custom_certificate = has_custom_certificate | ||
| self.pending_update_count = pending_update_count | ||
| self.last_error_date = kwargs.get('last_error_date') | ||
| self.last_error_message = kwargs.get('last_error_message') |
# Conflicts: # telegram/bot.py # telegram/callbackquery.py # telegram/chat.py # telegram/ext/messagehandler.py # telegram/inlinekeyboardbutton.py # telegram/inlinequeryresultcachedaudio.py # telegram/message.py # tests/test_filters.py
Add changes as of October 3, 2016.
Mostly games: https://core.telegram.org/bots/api#games
Other changes: https://core.telegram.org/bots/api#recent-changes
getWebhookInfoandWebhookInfoInputFileorfile_id(this requires disabling our own handling of this)answerCallbackQueryswitch_inline_query_current_chatsend_audio,send_voice,InlineQueryResultAudio,InlineQueryResultVoice, ``InlineQueryResultCachedAudioandInlineQueryResultCachedVoice`all_members_are_adminsinChatResponseParameters(no need unitests for the moment. we already had one response param and we didn't unitest it)