This is an example bot for the bot4j framework. It illustrates integration with Facebook, Telegram, Slack and Alexa and is a starting point for developing own bots based on bot4j.
- Clone or download this repo
- Start bot web server
- In Eclipse import the directory as a an
existing Maven project
. Right click classai.nitro.bot4j.Application
, chooseRun As
and clickJava Application
. A Jetty Web server will start on address0.0.0.0:4567
. - Alternatively you can start by
- In Eclipse import the directory as a an
$ mvn clean package exec:java
- Optionally install ngrok for exposing the web server on the internet. Start by
ngrok http 4567
. - Facebook setup
- Create a Facebook page, app, webhook and access token (cf. Facebook Messenger Platform Quick Start).
- Store the Facebook
access token
in filefacebook.properties
and restart the web server.
- Chat
- In Facebook Messenger send a message to your Facebook page. Facebook should forward the message via the configured webhook to your web server.
ExampleBot
will process the message and answer.
Licensed under the BSD 3-Clause License. See LICENSE for details.
Patches accepted, or create an issue!