Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gilacms/fb-messenger-bot
A simple Messenger Bot that uses regex expressions
https://github.com/gilacms/fb-messenger-bot
Last synced: 14 days ago
JSON representation
A simple Messenger Bot that uses regex expressions
- Host: GitHub
- URL: https://github.com/gilacms/fb-messenger-bot
- Owner: GilaCMS
- Created: 2019-04-04T12:20:47.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-23T17:17:28.000Z (over 4 years ago)
- Last Synced: 2024-11-06T22:07:00.769Z (2 months ago)
- Language: PHP
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fb-messenger-bot
A simple Messenger Bot that uses regex expressionsThis is a package for [Gila CMS](https://github.com/GilaCMS/gila)
Logo from [pixabay](https://pixabay.com/illustrations/bot-icon-robot-automated-cyborg-2883144/)
# Templates responses
Responses can be added in answers.phpDirect Message
```
return [ 'text' => "Hello" ];
```Generic Template
```
return ["attachment"=>[
"type"=>"template",
"payload"=>[
"template_type"=>"generic",
"elements"=>[
[
"title"=>"Gila CMS",
"image_url"=>"https://gilacms.com/assets/gila-logo.png",
"subtitle"=>"News and updates.",
"buttons"=>[
[
"type"=>"web_url",
"url"=>"https://gilacms.com",
"title"=>"View Website"
],
[
"type"=>"postback",
"title"=>"Start Chatting",
"payload"=>"DEVELOPER_DEFINED_PAYLOAD"
]
]
]
]
]]];
```Button
```
return ["attachment"=>[
"type"=>"template",
"payload"=>[
"template_type"=>"button",
"text"=>"What do you want to do next?",
"buttons"=>[
[
"type"=>"web_url",
"url"=>"https://gilacms.com/",
"title"=>"Show Website"
],
[
"type"=>"postback",
"title"=>"Start Chatting",
"payload"=>"USER_DEFINED_PAYLOAD"
]
]
]
]];
```List
```
return [
"attachment"=>[
"type"=>"template",
"payload"=>[
"template_type"=>"list",
"elements"=>[
[
"title"=> "Plastic filaments",
"image_url"=> "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4b/3D_Printing_Materials_%2816837486456%29.jpg/800px-3D_Printing_Materials_%2816837486456%29.jpg",
"subtitle"=> "See all our colors",
"default_action"=> [
"type"=> "web_url",
"url"=> "https://www.gilacms.com",
"webview_height_ratio"=> "tall",
],
"buttons"=>[
[
"type"=>"web_url",
"url"=>"https://www.gilacms.com/#",
"title"=>"Buy Now"
],
]
],
[
"title"=> "Plastic filaments",
"image_url"=> "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4b/3D_Printing_Materials_%2816837486456%29.jpg/800px-3D_Printing_Materials_%2816837486456%29.jpg",
"subtitle"=> "See all our colors",
"default_action"=> [
"type"=> "web_url",
"url"=> "https://www.gilacms.com",
"webview_height_ratio"=> "tall",
],
"buttons"=>[
[
"type"=>"web_url",
"url"=>"https://www.gilacms.com/#",
"title"=>"Buy Now"
],
]
]
]
]]];
```