Skip to content

Commit d4e2a08

Browse files
authored
Merge pull request #82 from line/feature/quick_reply
Support Quick Reply
2 parents 3e7dbcc + 057dc56 commit d4e2a08

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

examples/kitchensink/app.rb

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
THUMBNAIL_URL = 'https://via.placeholder.com/1024x1024'
55
HORIZONTAL_THUMBNAIL_URL = 'https://via.placeholder.com/1024x768'
6+
QUICK_REPLY_ICON_URL = 'https://via.placeholder.com/64x64'
67

78
def client
89
@client ||= Line::Bot::Client.new do |config|
@@ -363,6 +364,77 @@ def handle_message(event)
363364
}
364365
})
365366

367+
when 'quickreply'
368+
reply_content(event, {
369+
type: 'text',
370+
text: '[QUICK REPLY]',
371+
quickReply: {
372+
items: [
373+
{
374+
type: "action",
375+
imageUrl: QUICK_REPLY_ICON_URL,
376+
action: {
377+
type: "message",
378+
label: "Sushi",
379+
text: "Sushi"
380+
}
381+
},
382+
{
383+
type: "action",
384+
action: {
385+
type: "location",
386+
label: "Send location"
387+
}
388+
},
389+
{
390+
type: "action",
391+
imageUrl: QUICK_REPLY_ICON_URL,
392+
action: {
393+
type: "camera",
394+
label: "Open camera",
395+
}
396+
},
397+
{
398+
type: "action",
399+
imageUrl: QUICK_REPLY_ICON_URL,
400+
action: {
401+
type: "cameraRoll",
402+
label: "Open cameraRoll",
403+
}
404+
},
405+
{
406+
type: "action",
407+
action: {
408+
type: "postback",
409+
label: "buy",
410+
data: "action=buy&itemid=111",
411+
text: "buy",
412+
}
413+
},
414+
{
415+
type: "action",
416+
action: {
417+
type: "message",
418+
label: "Yes",
419+
text: "Yes"
420+
}
421+
},
422+
{
423+
type: "action",
424+
action: {
425+
type: "datetimepicker",
426+
label: "Select date",
427+
data: "storeId=12345",
428+
mode: "datetime",
429+
initial: "2017-12-25t00:00",
430+
max: "2018-01-24t23:59",
431+
min: "2017-12-25t00:00"
432+
}
433+
},
434+
],
435+
},
436+
})
437+
366438
when 'bye'
367439
case event['source']['type']
368440
when 'user'

0 commit comments

Comments
 (0)