Project

telepost

0.0
A long-lived project that still receives updates
Simple Telegram posting Ruby gem
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Ruby Telegram Client

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

rake 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.