File

Ruby wrapper for Telegram’s Bot API.

Installation

Add following line to your Gemfile:

And then execute:

Or install it system-wide:

Usage

First things first, you need to obtain a token for your bot. Then create your Telegram bot like this:

Note that bot.api object implements Telegram Bot API methods as is. So you can invoke any method inside the block without any problems.

Same thing about message object – it implements Message spec, so you always know what to expect from it.

Custom keyboards

You can use your own custom keyboards. Here is an example:

File upload

Your bot can even upload files (photos, audio, documents, stickers, video) to Telegram servers. Just like this:

Contributing

Leave a Reply

Your email address will not be published. Required fields are marked *