Skip to content

Commit e0359ea

Browse files
SombreroElGringoHyunje Jun
authored andcommitted
Quick Reply feature (#83)
Quick Reply feature implemented #79
1 parent 3ad5d93 commit e0359ea

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed

lib/types.ts

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,13 @@ export type TextMessage = {
258258
* Max: 2000 characters
259259
*/
260260
text: string;
261+
/**
262+
* These properties are used for the quick reply feature.
263+
* For more information, see [Using quick replies](https://developers.line.me/en/docs/messaging-api/using-quick-reply/).
264+
*
265+
* If the user receives multiple [message objects](https://developers.line.me/en/reference/messaging-api/#message-objects), the quickReply property of the last message object is displayed.
266+
*/
267+
quickReply?: QuickReply;
261268
};
262269

263270
/**
@@ -283,6 +290,13 @@ export type ImageMessage = {
283290
* - Max: 1 MB
284291
*/
285292
previewImageUrl: string;
293+
/**
294+
* These properties are used for the quick reply feature.
295+
* For more information, see [Using quick replies](https://developers.line.me/en/docs/messaging-api/using-quick-reply/).
296+
*
297+
* If the user receives multiple [message objects](https://developers.line.me/en/reference/messaging-api/#message-objects), the quickReply property of the last message object is displayed.
298+
*/
299+
quickReply?: QuickReply;
286300
};
287301

288302
/**
@@ -310,6 +324,13 @@ export type VideoMessage = {
310324
* - Max: 1 MB
311325
*/
312326
previewImageUrl: string;
327+
/**
328+
* These properties are used for the quick reply feature.
329+
* For more information, see [Using quick replies](https://developers.line.me/en/docs/messaging-api/using-quick-reply/).
330+
*
331+
* If the user receives multiple [message objects](https://developers.line.me/en/reference/messaging-api/#message-objects), the quickReply property of the last message object is displayed.
332+
*/
333+
quickReply?: QuickReply;
313334
};
314335

315336
/**
@@ -330,6 +351,13 @@ export type AudioMessage = {
330351
* Length of audio file (milliseconds)
331352
*/
332353
duration: number;
354+
/**
355+
* These properties are used for the quick reply feature.
356+
* For more information, see [Using quick replies](https://developers.line.me/en/docs/messaging-api/using-quick-reply/).
357+
*
358+
* If the user receives multiple [message objects](https://developers.line.me/en/reference/messaging-api/#message-objects), the quickReply property of the last message object is displayed.
359+
*/
360+
quickReply?: QuickReply;
333361
};
334362

335363
/**
@@ -347,6 +375,13 @@ export type LocationMessage = {
347375
address: string;
348376
latitude: number;
349377
longitude: number;
378+
/**
379+
* These properties are used for the quick reply feature.
380+
* For more information, see [Using quick replies](https://developers.line.me/en/docs/messaging-api/using-quick-reply/).
381+
*
382+
* If the user receives multiple [message objects](https://developers.line.me/en/reference/messaging-api/#message-objects), the quickReply property of the last message object is displayed.
383+
*/
384+
quickReply?: QuickReply;
350385
};
351386

352387
/**
@@ -364,6 +399,13 @@ export type StickerMessage = {
364399
* For a list of sticker IDs for stickers that can be sent with the Messaging API, see the [Sticker list](https://developers.line.me/media/messaging-api/sticker_list.pdf).
365400
*/
366401
stickerId: string;
402+
/**
403+
* These properties are used for the quick reply feature.
404+
* For more information, see [Using quick replies](https://developers.line.me/en/docs/messaging-api/using-quick-reply/).
405+
*
406+
* If the user receives multiple [message objects](https://developers.line.me/en/reference/messaging-api/#message-objects), the quickReply property of the last message object is displayed.
407+
*/
408+
quickReply?: QuickReply;
367409
};
368410

369411
/**
@@ -384,6 +426,13 @@ export type ImageMapMessage = {
384426
* Action when tapped (Max: 50)
385427
*/
386428
actions: ImageMapAction[];
429+
/**
430+
* These properties are used for the quick reply feature.
431+
* For more information, see [Using quick replies](https://developers.line.me/en/docs/messaging-api/using-quick-reply/).
432+
*
433+
* If the user receives multiple [message objects](https://developers.line.me/en/reference/messaging-api/#message-objects), the quickReply property of the last message object is displayed.
434+
*/
435+
quickReply?: QuickReply;
387436
};
388437

389438
/**
@@ -408,6 +457,13 @@ export type TemplateMessage = {
408457
* A [Buttons](https://developers.line.me/en/reference/messaging-api/#buttons), [Confirm](https://developers.line.me/en/reference/messaging-api/#confirm), [Carousel](https://developers.line.me/en/reference/messaging-api/#carousel), or [Image Carousel](https://developers.line.me/en/reference/messaging-api/#image-carousel) object.
409458
*/
410459
template: TemplateContent;
460+
/**
461+
* These properties are used for the quick reply feature.
462+
* For more information, see [Using quick replies](https://developers.line.me/en/docs/messaging-api/using-quick-reply/).
463+
*
464+
* If the user receives multiple [message objects](https://developers.line.me/en/reference/messaging-api/#message-objects), the quickReply property of the last message object is displayed.
465+
*/
466+
quickReply?: QuickReply;
411467
};
412468

413469
/**
@@ -421,6 +477,13 @@ export type FlexMessage = {
421477
type: "flex";
422478
altText: string;
423479
contents: FlexContainer;
480+
/**
481+
* These properties are used for the quick reply feature.
482+
* For more information, see [Using quick replies](https://developers.line.me/en/docs/messaging-api/using-quick-reply/).
483+
*
484+
* If the user receives multiple [message objects](https://developers.line.me/en/reference/messaging-api/#message-objects), the quickReply property of the last message object is displayed.
485+
*/
486+
quickReply?: QuickReply;
424487
};
425488

426489
/**
@@ -1119,6 +1182,52 @@ export type TemplateImageColumn = {
11191182
action: Action<{ label?: string }>;
11201183
};
11211184

1185+
/**
1186+
* These properties are used for the [quick reply](https://developers.line.me/en/reference/messaging-api/#quick-reply) feature.
1187+
* For more information, see [Using quick replies](https://developers.line.me/en/docs/messaging-api/using-quick-reply/).
1188+
*/
1189+
export type QuickReply = {
1190+
/**
1191+
* This is a container that contains [quick reply buttons](https://developers.line.me/en/reference/messaging-api/#quick-reply-button-object).
1192+
*
1193+
* Array of objects (Max: 13)
1194+
*/
1195+
items: Item[];
1196+
};
1197+
1198+
/**
1199+
* This is a quick reply option that is displayed as a button.
1200+
* For more information, see [quick reply buttons](https://developers.line.me/en/reference/messaging-api/#quick-reply-button-object).
1201+
*/
1202+
export type Item = {
1203+
type: "action";
1204+
/**
1205+
* URL of the icon that is displayed at the beginning of the button (Max: 1000 characters)
1206+
*
1207+
* - URL scheme: https
1208+
* - Image format: PNG
1209+
* - Aspect ratio: 1:1
1210+
* - Data size: Up to 1 MB
1211+
*
1212+
* There is no limit on the image size. If the `action` property has a [camera action](https://developers.line.me/en/reference/messaging-api/#camera-action),
1213+
* [camera roll action](https://developers.line.me/en/reference/messaging-api/#camera-roll-action), or [location action](https://developers.line.me/en/reference/messaging-api/#location-action), and the `imageUrl` property is not set,
1214+
* the default icon is displayed.
1215+
*/
1216+
imageUrl?: string;
1217+
/**
1218+
* Action performed when this button is tapped. Specify an [action object](https://developers.line.me/en/reference/messaging-api/#action-objects).
1219+
* The following is a list of the available actions:
1220+
*
1221+
* - [Postback action](https://developers.line.me/en/reference/messaging-api/#postback-action)
1222+
* - [Message action](https://developers.line.me/en/reference/messaging-api/#message-action)
1223+
* - [Datetime picker action](https://developers.line.me/en/reference/messaging-api/#datetime-picker-action)
1224+
* - [Camera action](https://developers.line.me/en/reference/messaging-api/#camera-action)
1225+
* - [Camera roll action](https://developers.line.me/en/reference/messaging-api/#camera-roll-action)
1226+
* - [Location action](https://developers.line.me/en/reference/messaging-api/#location-action)
1227+
*/
1228+
action: Action;
1229+
};
1230+
11221231
/**
11231232
* These are types of actions for your bot to take when a user taps a button or an image in a message.
11241233
*

0 commit comments

Comments
 (0)