@@ -741,6 +741,57 @@ def sendContact(self, chat_id, phone_number, first_name, last_name=None, **kwarg
741741
742742 return url , data
743743
744+ @log
745+ @message
746+ def sendGame (self ,
747+ chat_id ,
748+ game_short_name ,
749+ parse_mode = None ,
750+ disable_web_page_preview = None ,
751+ ** kwargs ):
752+ """Use this method to send game messages.
753+
754+ Args:
755+ chat_id (str): Unique identifier for the target chat or
756+ username of the target channel (in the format
757+ @channelusername).
758+ game_short_name (str): Short name of the game, serves as the unique
759+ identifier for the game.
760+ **kwargs (dict): Arbitrary keyword arguments.
761+
762+ Keyword Args:
763+ disable_notification (Optional[bool]): Sends the message silently.
764+ iOS users will not receive a notification, Android users will
765+ receive a notification with no sound.
766+ reply_to_message_id (Optional[int]): If the message is a reply,
767+ ID of the original message.
768+ reply_markup (Optional[:class:`telegram.ReplyMarkup`]): Additional
769+ interface options. A JSON-serialized object for an inline
770+ keyboard, custom reply keyboard, instructions to hide reply
771+ keyboard or to force a reply from the user.
772+ timeout (Optional[float]): If this value is specified, use it as
773+ the definitive timeout (in seconds) for urlopen() operations.
774+
775+ Returns:
776+ :class:`telegram.Message`: On success, the sent message is
777+ returned.
778+
779+ Raises:
780+ :class:`telegram.TelegramError`
781+
782+ """
783+
784+ url = '{0}/sendMessage' .format (self .base_url )
785+
786+ data = {'chat_id' : chat_id , 'game_short_name' : game_short_name }
787+
788+ if parse_mode :
789+ data ['parse_mode' ] = parse_mode
790+ if disable_web_page_preview :
791+ data ['disable_web_page_preview' ] = disable_web_page_preview
792+
793+ return url , data
794+
744795 @log
745796 @message
746797 def sendChatAction (self , chat_id , action , ** kwargs ):
@@ -1481,7 +1532,7 @@ def __reduce__(self):
14811532 return (self .__class__ , (self .token , self .base_url .replace (self .token , '' ),
14821533 self .base_file_url .replace (self .token , '' )))
14831534
1484- # snake_case (PEP8) aliases
1535+ # snake_case (PEP8) aliases
14851536
14861537 get_me = getMe
14871538 send_message = sendMessage
@@ -1495,6 +1546,7 @@ def __reduce__(self):
14951546 send_location = sendLocation
14961547 send_venue = sendVenue
14971548 send_contact = sendContact
1549+ send_game = sendGame
14981550 send_chat_action = sendChatAction
14991551 answer_inline_query = answerInlineQuery
15001552 get_user_profile_photos = getUserProfilePhotos
0 commit comments