Skip to content

rampatra/jbot

Repository files navigation

JBotBuild StatusCodacy BadgeJavadocsFacebookBackers on Open CollectiveSponsors on Open CollectiveMIT license

Make bots in Java.

JBotis a java framework(inspired byHowdyai's Botkit)to make Slack and Facebook bots in minutes. It provides all the boilerplate code needed so that you can make your bot live right away.

Why use JBot?

  • Provides you withall the boilerplate codewhich handles underlying websocket connections and other complexities.
  • Supportsextra eventsin addition to all the events supported by Slack/Facebook which makes your work a lot more easier.
  • Receiving & sending messagesis as easy as defining a@Controllerand callingreply().
  • Conversation featureof JBot makes talking to your bot a breeze. This feature makes JBot different than rest of the Java frameworks out there.
  • Well testedwith good coverage unit tests.
  • And many other features which can't just be mentioned here.

Not satisfied?Read on...

Still worried?Open anissue on Githuband we can discuss.

JBot for Slack

Running your SlackBot is just 4 easy steps:

  1. Clone this project$ git clone https://github /rampatra/jbot.git.
  2. Create a slack botand get your slack token.
  3. Paste the token inapplication.propertiesfile.
  4. Run the example application by runningJBotApplicationin your IDE or via commandline:
    $cdjbot
    $ mvn clean install
    $cdjbot-example
    $ mvn spring-boot:run

You can now start talking with your bot;)

Read the detailedSlack documentationto learn more.

JBot for Facebook

Similar to Slack, Facebook is simple too but has a few extra steps:

  1. Clone this project$ git clone git@github:rampatra/jbot.git.
  2. Create afacebook appand a page.
  3. Generate a Page Access Token for the page (inside app's messenger settings).
  4. Paste the token created above inapplication.propertiesfile.
  5. Run the example application by runningJBotApplicationin your IDE or via commandline:
    $cdjbot
    $ mvn clean install
    $cdjbot-example
    $ mvn spring-boot:run
  6. Setup webhook to receive messages and other events. You need to have a public address to setup webhook. You may use localtunnel.meto generate a public address if you're running locally on your machine.
  7. Specify the address created above in "Callback Url" field under "Webooks" setting and give the verify token asfb_token_for_jbotand click "Verify and Save".

You can now start messaging your bot by going to the facebook page and clicking on the "Send message" button.

If you're too lazy to start now and just want to play around, you can tryjbot-exampleby visiting JBot facebook pageand clicking on the "Send Message" button.-- The server is currently down

Read the detailedFacebook documentationto learn more.

Contributors

This project exists thanks to all the awesome people who contribute. If you want to flaunt your skills and make the project better,you can start contributing,and for any queries please just raise an issueand I would be more than happy to discuss:)

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]


P.S. For any queries or concerns, you can reach out to me onTwitter.I'll try my best to help 🙏.