To start your Phoenix server:
- Checkout to the directory
- Install dependencies with
mix deps.get
- Start Phoenix endpoint with
mix phx.server
or inside IEx withiex -S mix phx.server
Now you can visit localhost:4000
from your browser.
Ready to run in production? Please check our deployment guides.
- Create an account on
developers.facebook.com
- Create an App for the Bot
- Add Messenger as product
- Create & Attach a facebook page to the above app
- Go to Messenger settings
- Use
Generate token
, this is yourFB_PAGE_ACCESS_TOKEN
- Subscribe to
messages
andmessaging_postbacks
webhooks for the Page
- Add Callback webhook, in the format
https://example.com/api/facebook_webhook
- Ready to interact.
If you're on local, you can use ngrok http 4000
for forward your requests.
- Send
hi
to the Bot on Messenger. - Send
list <query>
to search for top 5 coins matchingquery
. Example - Sendlist usd
to search all coins matching withusd
- Click on any of the coin presented to fetch last 14 days prices for it.
docker build ./ -t ex_bot
docker run -it -e SECRET_KEY_BASE='<Your Base Here>' -e FB_PAGE_ACCESS_TOKEN='<Your PAT Here>' -p 4000:4000 ex_bot