A Facebook Messenger Bot Example using prometheus-ai/fb-messenger-clj
.
The Bot replies with "Hello World!" on any text input and returns an image when the user types "image".
- Facebook Messenger Authentication (api.clj)
- Predefined fallback replies (messages.clj)
- Predefined handlers (bot.clj) with standard fallback messages when receiving
- Text Message
- Quick Reply
- Attachment
- Postback
- Referral
To start a web server for the application, run:
lein ring server-headless
Run ngrok http 3000
(read more about ngrok)
Provide your Facebook Page Access Token, Verify Token and Page Secret for local development by creating a file called profiles.clj
in the root directory /profiles.clj
.
{:dev {:env {:page-access-token "REPLACE"
:page-secret "REPLACE"
:verify-token "REPLACE"}}}
Also check out this step-by-step guide for further details on getting your development environment for a Facebook Messenger Bot up and running in Clojure.