Skip to content

Commit c716bd2

Browse files
authored
Update documents (#206)
* update URLs * add description about FlexSendMessage to README * modify description in README * add comments about passing dict to FlexSendMessage#contents * fix URL
1 parent 3bbb5f0 commit c716bd2

File tree

1 file changed

+66
-25
lines changed

1 file changed

+66
-25
lines changed

README.rst

Lines changed: 66 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ reply\_message(self, reply\_token, messages, timeout=None)
108108
Respond to events from users, groups, and rooms. You can get a
109109
reply\_token from a webhook event object.
110110

111-
https://developers.line.me/en/docs/messaging-api/reference/#send-reply-message
111+
https://developers.line.biz/en/reference/messaging-api/#send-reply-message
112112

113113
.. code:: python
114114
@@ -119,7 +119,7 @@ push\_message(self, to, messages, timeout=None)
119119

120120
Send messages to users, groups, and rooms at any time.
121121

122-
https://developers.line.me/en/docs/messaging-api/reference/#send-push-message
122+
https://developers.line.biz/en/reference/messaging-api/#send-push-message
123123

124124
.. code:: python
125125
@@ -130,7 +130,7 @@ multicast(self, to, messages, timeout=None)
130130

131131
Send messages to multiple users at any time.
132132

133-
https://developers.line.me/en/docs/messaging-api/reference/#send-multicast-messages
133+
https://developers.line.biz/en/reference/messaging-api/#send-multicast-message
134134

135135
.. code:: python
136136
@@ -141,7 +141,7 @@ get\_profile(self, user\_id, timeout=None)
141141

142142
Get user profile information.
143143

144-
https://developers.line.me/en/docs/messaging-api/reference/#get-profile
144+
https://developers.line.biz/en/reference/messaging-api/#get-profile
145145

146146
.. code:: python
147147
@@ -159,7 +159,7 @@ Gets the user profile of a member of a group that the bot is in. This can be
159159
the user ID of a user who has not added the bot as a friend or has blocked
160160
the bot.
161161

162-
https://developers.line.me/en/docs/messaging-api/reference/#get-group-member-profile
162+
https://developers.line.biz/en/reference/messaging-api/#get-group-member-profile
163163

164164
.. code:: python
165165
@@ -175,7 +175,7 @@ get\_room\_member\_profile(self, room\_id, user\_id, timeout=None)
175175
Gets the user profile of a member of a room that the bot is in. This can be the
176176
user ID of a user who has not added the bot as a friend or has blocked the bot.
177177

178-
https://developers.line.me/en/docs/messaging-api/reference/#get-room-member-profile
178+
https://developers.line.biz/en/reference/messaging-api/#get-room-member-profile
179179

180180
.. code:: python
181181
@@ -191,7 +191,7 @@ get\_group\_member\_ids(self, group\_id, start=None, timeout=None)
191191
Gets the user IDs of the members of a group that the bot is in.
192192
This includes the user IDs of users who have not added the bot as a friend or has blocked the bot.
193193

194-
https://developers.line.me/en/docs/messaging-api/reference/#get-group-member-user-ids
194+
https://developers.line.biz/en/reference/messaging-api/#get-group-member-user-ids
195195

196196
.. code:: python
197197
@@ -206,7 +206,7 @@ get\_room\_member\_ids(self, room\_id, start=None, timeout=None)
206206
Gets the user IDs of the members of a room that the bot is in.
207207
This includes the user IDs of users who have not added the bot as a friend or has blocked the bot.
208208

209-
https://developers.line.me/en/docs/messaging-api/reference/#get-room-member-user-ids
209+
https://developers.line.biz/en/reference/messaging-api/#get-room-member-user-ids
210210

211211
.. code:: python
212212
@@ -220,7 +220,7 @@ get\_message\_content(self, message\_id, timeout=None)
220220

221221
Retrieve image, video, and audio data sent by users.
222222

223-
https://developers.line.me/en/docs/messaging-api/reference/#get-content
223+
https://developers.line.biz/en/reference/messaging-api/#get-content
224224

225225
.. code:: python
226226
@@ -235,7 +235,7 @@ leave\_group(self, group\_id, timeout=None)
235235

236236
Leave a group.
237237

238-
https://developers.line.me/en/docs/messaging-api/reference/#leave-group
238+
https://developers.line.biz/en/reference/messaging-api/#leave-group
239239

240240
.. code:: python
241241
@@ -246,7 +246,7 @@ leave\_room(self, room\_id, timeout=None)
246246

247247
Leave a room.
248248

249-
https://developers.line.me/en/docs/messaging-api/reference/#leave-room
249+
https://developers.line.biz/en/reference/messaging-api/#leave-room
250250

251251
.. code:: python
252252
@@ -257,7 +257,7 @@ get\_rich\_menu(self, rich\_menu\_id, timeout=None)
257257

258258
Gets a rich menu via a rich menu ID.
259259

260-
https://developers.line.me/en/docs/messaging-api/reference/#get-rich-menu
260+
https://developers.line.biz/en/reference/messaging-api/#get-rich-menu
261261

262262
.. code:: python
263263
@@ -270,7 +270,7 @@ create\_rich\_menu(self, rich\_menu, timeout=None)
270270
Creates a rich menu.
271271
You must upload a rich menu image and link the rich menu to a user for the rich menu to be displayed. You can create up to 10 rich menus for one bot.
272272

273-
https://developers.line.me/en/docs/messaging-api/reference/#create-rich-menu
273+
https://developers.line.biz/en/reference/messaging-api/#create-rich-menu
274274

275275
.. code:: python
276276
@@ -291,7 +291,7 @@ delete\_rich\_menu(self, rich\_menu\_id, timeout=None)
291291

292292
Deletes a rich menu.
293293

294-
https://developers.line.me/en/docs/messaging-api/reference/#delete-rich-menu
294+
https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu
295295

296296
.. code:: python
297297
@@ -302,7 +302,7 @@ get\_rich\_menu\_id\_of\_user(self, user\_id, timeout=None)
302302

303303
Gets the ID of the rich menu linked to a user.
304304

305-
https://developers.line.me/en/docs/messaging-api/reference/#get-rich-menu-id-of-user
305+
https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-id-of-user
306306

307307
.. code:: python
308308
@@ -314,7 +314,7 @@ link\_rich\_menu\_to\_user(self, user\_id, rich\_menu\_id, timeout=None)
314314

315315
Links a rich menu to a user. Only one rich menu can be linked to a user at one time.
316316

317-
https://developers.line.me/en/docs/messaging-api/reference/#link-rich-menu-to-user
317+
https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-user
318318

319319
.. code:: python
320320
@@ -336,7 +336,7 @@ unlink\_rich\_menu\_from\_user(self, user\_id, timeout=None)
336336

337337
Unlinks a rich menu from a user.
338338

339-
https://developers.line.me/en/docs/messaging-api/reference/#unlink-rich-menu-from-user
339+
https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-user
340340

341341
.. code:: python
342342
@@ -358,7 +358,7 @@ get\_rich\_menu\_image(self, rich\_menu\_id, timeout=None)
358358

359359
Downloads an image associated with a rich menu.
360360

361-
https://developers.line.me/en/docs/messaging-api/reference/#download-rich-menu-image
361+
https://developers.line.biz/en/reference/messaging-api/#download-rich-menu-image
362362

363363
.. code:: python
364364
@@ -372,7 +372,7 @@ set\_rich\_menu\_image(self, rich\_menu\_id, content\_type, content, timeout=Non
372372

373373
Uploads and attaches an image to a rich menu.
374374

375-
https://developers.line.me/en/docs/messaging-api/reference/#upload-rich-menu-image
375+
https://developers.line.biz/en/reference/messaging-api/#upload-rich-menu-image
376376

377377
.. code:: python
378378
@@ -384,7 +384,7 @@ get\_rich\_menu\_list(self, timeout=None)
384384

385385
Gets a list of all uploaded rich menus.
386386

387-
https://developers.line.me/en/docs/messaging-api/reference/#get-rich-menu-list
387+
https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-list
388388

389389
.. code:: python
390390
@@ -501,7 +501,7 @@ https://developers.line.biz/en/reference/messaging-api/#get-demographic
501501

502502
If the LINE API server returns an error, LineBotApi raises LineBotApiError.
503503

504-
https://developers.line.me/en/docs/messaging-api/reference/#error-responses
504+
https://developers.line.biz/en/reference/messaging-api/#error-responses
505505

506506
.. code:: python
507507
@@ -515,7 +515,7 @@ https://developers.line.me/en/docs/messaging-api/reference/#error-responses
515515
Message objects
516516
~~~~~~~~~~~~~~~
517517

518-
https://developers.line.me/en/docs/messaging-api/reference/#message-objects
518+
https://developers.line.biz/en/reference/messaging-api/#message-objects
519519

520520
The following classes are found in the ``linebot.models`` package.
521521

@@ -748,6 +748,47 @@ TemplateSendMessage - ImageCarouselTemplate
748748
)
749749
)
750750
751+
FlexSendMessage
752+
^^^^^^^^^^^^^^^^
753+
754+
.. code:: python
755+
756+
flex_message = FlexSendMessage(
757+
alt_text='hello',
758+
contents=BubbleContainer(
759+
direction='ltr',
760+
hero=ImageComponent(
761+
url='https://example.com/cafe.jpg',
762+
size='full',
763+
aspect_ratio='20:13',
764+
aspect_mode='cover',
765+
action=URIAction(uri='http://example.com', label='label')
766+
)
767+
)
768+
)
769+
770+
※ You can pass a **dict** to FlexSendMessage#contents as follows:
771+
772+
.. code:: python
773+
774+
flex_message = FlexSendMessage(
775+
alt_text='hello',
776+
contents={
777+
type: 'bubble',
778+
direction: 'ltr',
779+
hero: {
780+
type: 'image',
781+
url: 'https://example.com/cafe.jpg',
782+
size: 'full',
783+
aspectRatio: '20:13',
784+
aspectMode: 'cover',
785+
action: { type: 'uri', uri: 'http://example.com', label: 'label' }
786+
}
787+
}
788+
)
789+
790+
Thus, You can send a JSON designed with `Flex Message Simulator <https://developers.line.biz/console/fx/>`__.
791+
751792
With QuickReply
752793
^^^^^^^^^^^^^^^
753794

@@ -764,7 +805,7 @@ Webhook
764805
WebhookParser
765806
~~~~~~~~~~~~~
766807

767-
※ You can use WebhookParser or WebhookHandler
808+
※ You can use WebhookParser
768809

769810
\_\_init\_\_(self, channel\_secret)
770811
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -796,7 +837,7 @@ If the signature does NOT match, ``InvalidSignatureError`` is raised.
796837
WebhookHandler
797838
~~~~~~~~~~~~~~
798839

799-
※ You can use WebhookParser or WebhookHandler
840+
※ You can use WebhookHandler
800841

801842
\_\_init\_\_(self, channel\_secret)
802843
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -874,7 +915,7 @@ https://developers.line.biz/en/reference/messaging-api/#request-body
874915
Webhook event object
875916
~~~~~~~~~~~~~~~~~~~~
876917

877-
https://developers.line.me/en/docs/messaging-api/reference/#webhook-event-objects
918+
https://developers.line.biz/en/reference/messaging-api/#webhook-event-objects
878919

879920
The following classes are found in the ``linebot.models`` package.
880921

0 commit comments

Comments
 (0)