
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
The aim of this gem is to provide a useful wrapper of Telegram's Bot API that makes use of Webhooks functionality.
Add this line to your application's Gemfile:
gem 'fantastic_robot'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fantastic_robot
Gem configuration can be initialized by running a custom generator:
$ rails g fantastic_robot:install
Then, you can change the configuration by editing the file located at config/initializers/fantastic_robot.rb
At least, you should include:
Important: your webhook we'll be registered only if the delivery_method is set to :delivery_method.
This gem provides models to access easily to API updates, and to create responses and requests to send messages and attachments to Telegram.
Used to parse received data from Telegram.
Available models are:
If you want to know the variables available in each one, you can check the official docs.
And they can be instantiated like any other model. You will commonly receive an Update object:
received_hash = JSON.parse(request.body.read)
received_update = FantasticRobot::Model::Update.new(received_hash)
Associated models (like the Message included inside the Update) will be automatically converted when instantiating the Update object.
Request are objects that can receive (and validate) the parameters that can be sent in a request to the API.
The available requests are:
If you want to know the variables available in each one, you can check the official docs.
There are two ways of sending a request:
#send_request method available in all request classes:req = FantasticRobot::Request::GetMe.new()
response = req.send_request
Note: if the API returns an error, a Faraday::Error exception will be raised
def receive
received = FantasticRobot::Model::Update.new(JSON.parse(request.body.read))
response = FantasticRobot::Request::SendMessage.new({
chat_id: received.message.chat.id,
text: "Okay! I've got it!",
reply_to_message_id: received.message.message_id
})
render json: response
end
Several tests have been implemented to verify that model an requests behave as expected.
So please, if you want to contribute to this gem, check that tests are maintained and all of them pass.
There are several thing to do on this project:
If you want to check out the gem's source code and want to contribute, you are welcome!
Bug reports and pull requests are welcome on GitHub at https://github.com/odarriba/fantastic_robot. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
Everyone's contributions are welcome, so if you want to contribute, just fork this repo, make the changes you want and create a descriptive pull request :)
The gem is available as open source under the terms of the MIT License as can be seen in LICENSE file.
FAQs
Unknown package
We found that fantastic_robot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.