Skip to content
Simple Telegram posting Ruby gem
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.0pdd.yml
.gitignore
.pdd
.rubocop.yml
.rultor.yml
.travis.yml
Gemfile
LICENSE.txt
README.md
Rakefile
appveyor.yml
logo.svg
telepost.gemspec

README.md

EO principles respected here DevOps By Rultor.com We recommend RubyMine

Build Status Gem Version Maintainability Yard Docs

Hits-of-Code

Telepost is a simple gateway to Telegram, which can post messages and respond to primitive requests.

First, get your token from @BotFather.

Then, install it:

$ gem install telepost

Then, use it like this:

require 'telepost'
tp = Telepost.new('..token..')
Thread.start do
  tp.run do |chat, msg|
    tp.post(chat, 'Thanks for talking to me!')
  end
end
tp.post(12345, 'How are you?', 'How are you doing?')

All lines you provide to the post() method will be concatenated with a space between them.

Or you can pre-configure it to talk to certain list of chats. Your bot has to be an admin of the channel, in order to post there. Here is how you "spam":

tp = Telepost.new('..token..', chats: ['my_channel'])
tp.spam('How are you?')

That's it.

How to contribute

Read these guidelines. Make sure you build is green before you contribute your pull request. You will need to have Ruby 2.3+ and Bundler installed. Then:

$ bundle update
$ bundle exec rake

If it's clean and you don't see any error messages, submit your pull request.

You can’t perform that action at this time.