添加菜单事件
This commit is contained in:
parent
9f667588c4
commit
40047ff818
|
@ -54,6 +54,14 @@ class WechatsController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
on :click, with: 'MY_NEWS' do |request, key|
|
||||
|
||||
news = (1..count.to_i).each_with_object([]) { |n, memo| memo << { title: 'News title', content: "No. #{n} news content" } }
|
||||
request.reply.news(news) do |article, n, index| # article is return object
|
||||
article.item title: "#{index} #{n[:title]}", description: n[:content], pic_url: 'http://www.baidu.com/img/bdlogo.gif', url: 'http://www.baidu.com/'
|
||||
end
|
||||
end
|
||||
|
||||
# When user click the menu button
|
||||
on :click, with: 'BOOK_LUNCH' do |request, key|
|
||||
request.reply.text "User: #{request[:FromUserName]} click #{key}"
|
||||
|
|
Loading…
Reference in New Issue