CanDoGram – Telegram bot wrapper for Java EE


So there’s a pretty great wrapper for the Telegram API for Java – check it out here. I started creating a bot in it and, being naturally Java EE inclined, wanted to push it into a Java EE environment. The more I taught my bot, the more an EE framework started emerging around it.

The actual core framework is great, my library is just a convenience wrapper around it that does two major things

  • makes it easier to deploy into an EE container, and
  • provides support for long-running conversations, via persisted JSON ‘memories’ for each chat

In the future, I’d like to wrap whatever other good chat API frameworks emerge, but for now it’s just looking at Telegram.


Well, if you’re on Telegram, invite @zaFoolBot (we call him SpamBot for early bug-spam reasons) to your chat. The bot does several (fairly South African orientated) things, such as

  • take and repeat notes
  • act as an 8-ball
  • let you play Russian roulette
  • hurl abuse at people, Secret of Monkey Island-style
  • Zalgo-ify text for you
  • search TVDB for the next episode of upcoming series
  • check the South African National Lottery website for current lottery amounts
  • search Ster-Kinekor’s site for a particular movie, and ask SpamBot to monitor the movie for when it starts booking. SpamBot will message you when booking opens

As well as various other functionalities, depending on what I’ve been playing with recently.

If you’re not on Telegram, this probably won’t be fascinating for you.

Looking forwards

The Bot API, SpamBot, the demo, all of them, are nowhere near anywhere they’ll be / might be / never be someday. But the library has been sitting on my PC for ages now, so it seemed safer to push it up into the world instead.

You can check out the library here, and check out the super basic demo project here.

If you have any questions, feel free to post them. Find any bugs? Feel free to raise issues. Have a great idea? Feel free to contribute πŸ˜‰

Tagged with: ,
Posted in Java

Leave a Reply