Skip to content

Commit acadd4b

Browse files
authored
Update Documentation (#244)
* fix indentation warnings of sphinx-build * update docs/ for new modules * update README for narrowcast
1 parent 91300c1 commit acadd4b

File tree

3 files changed

+67
-14
lines changed

3 files changed

+67
-14
lines changed

README.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,39 @@ https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message
147147
148148
line_bot_api.broadcast(TextSendMessage(text='Hello World!'))
149149
150+
narrowcast(self, messages, recipient=None, filter=None, limit=None, timeout=None)
151+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152+
153+
Sends a push message to multiple users specified by attributes (such as age, gender, OS, and region)
154+
or retargeting (audiences).
155+
156+
https://developers.line.biz/en/reference/messaging-api/#send-narrowcast-message
157+
158+
.. code:: python
159+
160+
line_bot_api.narrowcast(
161+
messages=TextSendMessage(text='Hello World!'),
162+
recipient=AudienceRecipient(group_id=5614991017776),
163+
filter=Filter(demographic=AgeFilter(gte="age_35", lt="age_40")),
164+
limit=Limit(max=10)
165+
)
166+
167+
get_progress_status_narrowcast(self, request_id, timeout=None)
168+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
169+
170+
Get progress status of narrowcast messages sent.
171+
172+
https://developers.line.biz/en/reference/messaging-api/#get-narrowcast-progress-status
173+
174+
.. code:: python
175+
176+
narrowcast_progress = line_bot_api.get_progress_status_narrowcast(request_id)
177+
assert narrowcast_progress.phase == 'succeeded'
178+
print(narrowcast.success_count)
179+
print(narrowcast.failure_count)
180+
print(narrowcast.target_count)
181+
182+
150183
get\_profile(self, user\_id, timeout=None)
151184
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152185

docs/source/linebot.models.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ linebot.models.events module
2222

2323
.. automodule:: linebot.models.events
2424

25+
linebot.models.filter module
26+
-----------------------------------
27+
28+
.. automodule:: linebot.models.filter
29+
2530
linebot.models.flex_message module
2631
-----------------------------------
2732

@@ -37,11 +42,26 @@ linebot.models.insight module
3742

3843
.. automodule:: linebot.models.insight
3944

45+
linebot.models.limit module
46+
------------------------------
47+
48+
.. automodule:: linebot.models.limit
49+
4050
linebot.models.messages module
4151
------------------------------
4252

4353
.. automodule:: linebot.models.messages
4454

55+
linebot.models.operator module
56+
-------------------------------
57+
58+
.. automodule:: linebot.models.operator
59+
60+
linebot.models.recipient module
61+
-------------------------------
62+
63+
.. automodule:: linebot.models.recipient
64+
4565
linebot.models.responses module
4666
-------------------------------
4767

linebot/models/insight.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ def __init__(self, request_id=None, timestamp=None, delivered=None,
122122
:param str request_id: Request ID.
123123
:param int timestamp: UNIX timestamp for message delivery time.
124124
:param int delivered: Number of messages delivered. This property shows values
125-
of less than 20.
125+
of less than 20.
126126
:param int unique_impression: Number of people who opened the message,
127-
meaning they displayed at least 1 bubble.
127+
meaning they displayed at least 1 bubble.
128128
:param int unique_click: Number of people who opened any URL in the message.
129129
:param int unique_media_played: Number of people who started playing any video
130-
or audio in the message.
130+
or audio in the message.
131131
:param int unique_media_played_100_percent: Number of people who played the entirety of
132-
any video or audio in the message.
132+
any video or audio in the message.
133133
"""
134134
super(MessageStatistics, self).__init__(**kwargs)
135135

@@ -157,23 +157,23 @@ def __init__(self, seq=None, impression=None, media_played=None,
157157
:param int impression: Number of times the bubble was displayed.
158158
:param int media_played: Number of times audio or video in the bubble started playing.
159159
:param int media_played_25_percent: Number of times audio or video
160-
in the bubble was played from start to 25%.
160+
in the bubble was played from start to 25%.
161161
:param int media_played_50_percent: Number of times audio or video
162-
in the bubble was played from start to 50%.
162+
in the bubble was played from start to 50%.
163163
:param int media_played_75_percent: Number of times audio or video
164-
in the bubble was played from start to 75%.
164+
in the bubble was played from start to 75%.
165165
:param int media_played_100_percent: Number of times audio or video
166-
in the bubble was played in its entirety.
166+
in the bubble was played in its entirety.
167167
:param int unique_media_played: Number of people that started playing
168-
audio or video in the bubble.
168+
audio or video in the bubble.
169169
:param int unique_media_played_25_percent: Number of people that played
170-
audio or video in the bubble from start to 25%.
170+
audio or video in the bubble from start to 25%.
171171
:param int unique_media_played_50_percent: Number of people that played
172-
audio or video in the bubble from start to 50%.
172+
audio or video in the bubble from start to 50%.
173173
:param int unique_media_played_75_percent: Number of people that played
174-
audio or video in the bubble from start to 75%.
174+
audio or video in the bubble from start to 75%.
175175
:param int unique_media_played_100_percent: Number of people that played
176-
audio or video in the bubble in its entirety.
176+
audio or video in the bubble in its entirety.
177177
"""
178178
super(MessageInsight, self).__init__(**kwargs)
179179

@@ -203,7 +203,7 @@ def __init__(self, seq=None, url=None, click=None, unique_click=None,
203203
:param int click: Number of times the URL was opened.
204204
:param int unique_click: Number of people that opened the URL.
205205
:param int unique_click_of_request: Number of people who opened this url
206-
through any link in the message.
206+
through any link in the message.
207207
"""
208208
super(ClickInsight, self).__init__(**kwargs)
209209

0 commit comments

Comments
 (0)