X Tutup
Skip to content

Commit ed170e1

Browse files
committed
Bootstrapping InputMessageContent classes python-telegram-bot#232
1 parent 46ca28f commit ed170e1

26 files changed

+140
-4
lines changed

telegram/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@
6565
from .inlinequeryresultvenue import InlineQueryResultVenue
6666
from .inlinequeryresultvideo import InlineQueryResultVideo
6767
from .inlinequeryresultvoice import InlineQueryResultVoice
68+
from .inputmessagecontent import InputMessageContent
69+
from .inputtextmessagecontent import InputTextMessageContent
70+
from .inputlocationmessagecontent import InputLocationMessageContent
71+
from .inputvenuemessagecontent import InputVenueMessageContent
72+
from .inputcontactmessagecontent import InputContactMessageContent
6873
from .update import Update
6974
from .bot import Bot
7075

@@ -119,4 +124,7 @@ def JobQueue(*args, **kwargs):
119124
'InlineQueryResultDocument', 'InlineQueryResultGif',
120125
'InlineQueryResultLocation', 'InlineQueryResultMpeg4Gif',
121126
'InlineQueryResultPhoto', 'InlineQueryResultVenue',
122-
'InlineQueryResultVideo', 'InlineQueryResultVoice')
127+
'InlineQueryResultVideo', 'InlineQueryResultVoice',
128+
'InputMessageContent', 'InputTextMessageContent',
129+
'InputLocationMessageContent', 'InputVenueMessageContent',
130+
'InputContactMessageContent')

telegram/inlinequeryresult.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env python
22
#
33
# A library that provides a Python interface to the Telegram Bot API
4-
# Copyright (C) 2015 Leandro Toledo de Souza <devs@python-telegram-bot.org>
4+
# Copyright (C) 2015-2016
5+
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
56
#
67
# This program is free software: you can redistribute it and/or modify
78
# it under the terms of the GNU Lesser Public License as published by
@@ -17,7 +18,7 @@
1718
# along with this program. If not, see [http://www.gnu.org/licenses/].
1819

1920
"""This module contains the classes that represent Telegram
20-
InlineQueryResults"""
21+
InlineQueryResult"""
2122

2223
from telegram import TelegramObject
2324

telegram/inlinequeryresultarticle.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
# You should have received a copy of the GNU Lesser Public License
1818
# along with this program. If not, see [http://www.gnu.org/licenses/].
1919

20+
"""This module contains the classes that represent Telegram
21+
InlineQueryResultArticle"""
22+
2023
from telegram import InlineQueryResult
2124
from telegram.utils.validate import validate_string
2225

telegram/inlinequeryresultaudio.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,33 @@
1717
# You should have received a copy of the GNU Lesser Public License
1818
# along with this program. If not, see [http://www.gnu.org/licenses/].
1919

20+
"""This module contains the classes that represent Telegram
21+
InlineQueryResultAudio"""
22+
2023
from telegram import InlineQueryResult
2124
from telegram.utils.validate import validate_string
2225

2326

2427
class InlineQueryResultAudio(InlineQueryResult):
25-
pass
28+
29+
def __init__(self,
30+
id,
31+
audio_url,
32+
title,
33+
performer=None,
34+
audio_duration=None,
35+
reply_markup=None,
36+
input_message_content=None):
37+
38+
# Required
39+
super(InlineQueryResultAudio, self).__init__('audio', id)
40+
self.audio_url = audio_url
41+
self.title = title
42+
43+
# Optional
44+
self.performer = performer
45+
self.audio_duration = audio_duration
46+
if reply_markup is not None:
47+
self.reply_markup = 'ReplyMarkup' # TODO
48+
if input_message_content is not None:
49+
self.input_message_content = 'InputMessageContent'

telegram/inlinequeryresultcachedaudio.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
# You should have received a copy of the GNU Lesser Public License
1818
# along with this program. If not, see [http://www.gnu.org/licenses/].
1919

20+
"""This module contains the classes that represent Telegram
21+
InlineQueryResultCachedAudio"""
22+
2023
from telegram import InlineQueryResult
2124
from telegram.utils.validate import validate_string
2225

telegram/inlinequeryresultcacheddocument.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
# You should have received a copy of the GNU Lesser Public License
1818
# along with this program. If not, see [http://www.gnu.org/licenses/].
1919

20+
"""This module contains the classes that represent Telegram
21+
InlineQueryResultCachedDocument"""
22+
2023
from telegram import InlineQueryResult
2124
from telegram.utils.validate import validate_string
2225

telegram/inlinequeryresultcachedgif.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
# You should have received a copy of the GNU Lesser Public License
1818
# along with this program. If not, see [http://www.gnu.org/licenses/].
1919

20+
"""This module contains the classes that represent Telegram
21+
InlineQueryResultCachedGif"""
22+
2023
from telegram import InlineQueryResult
2124
from telegram.utils.validate import validate_string
2225

telegram/inlinequeryresultcachedmpeg4gif.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
# You should have received a copy of the GNU Lesser Public License
1818
# along with this program. If not, see [http://www.gnu.org/licenses/].
1919

20+
"""This module contains the classes that represent Telegram
21+
InlineQueryResultMpeg4Gif"""
22+
2023
from telegram import InlineQueryResult
2124
from telegram.utils.validate import validate_string
2225

telegram/inlinequeryresultcachedphoto.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
# You should have received a copy of the GNU Lesser Public License
1818
# along with this program. If not, see [http://www.gnu.org/licenses/].
1919

20+
"""This module contains the classes that represent Telegram
21+
InlineQueryResultPhoto"""
22+
2023
from telegram import InlineQueryResult
2124
from telegram.utils.validate import validate_string
2225

telegram/inlinequeryresultcachedsticker.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
# You should have received a copy of the GNU Lesser Public License
1818
# along with this program. If not, see [http://www.gnu.org/licenses/].
1919

20+
"""This module contains the classes that represent Telegram
21+
InlineQueryResultCachedSticker"""
22+
2023
from telegram import InlineQueryResult
2124
from telegram.utils.validate import validate_string
2225

0 commit comments

Comments
 (0)
X Tutup