Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iaguirre88/exception_notification_telegram
Telegram notifier for exception notification gem
https://github.com/iaguirre88/exception_notification_telegram
exception-notification rails ruby telegram telegram-notifier
Last synced: 2 days ago
JSON representation
Telegram notifier for exception notification gem
- Host: GitHub
- URL: https://github.com/iaguirre88/exception_notification_telegram
- Owner: iaguirre88
- License: mit
- Created: 2019-02-20T00:44:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-02T12:11:57.000Z (over 1 year ago)
- Last Synced: 2024-10-13T06:29:36.045Z (about 1 month ago)
- Topics: exception-notification, rails, ruby, telegram, telegram-notifier
- Language: Ruby
- Homepage:
- Size: 28.3 KB
- Stars: 9
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Exception Notification - Telegram Notifier
[![Gem Version](https://badge.fury.io/rb/exception_notification_telegram.svg)](https://badge.fury.io/rb/exception_notification_telegram)
[![Build Status](https://github.com/iaguirre88/exception_notification_telegram/actions/workflows/ruby.yml/badge.svg)](https://github.com/iaguirre88/exception_notification_telegram/actions/workflows/ruby.yml)---
The [Exception Notification](https://github.com/smartinez87/exception_notification) gem provides a set of notifiers for sending notifications when errors occur in a Rack/Rails application. This gem adds support for delivering notifications to Telegram.
## Requirements
* Ruby 2.7 or greater## Installation
Add this line to your application's Gemfile:
```ruby
gem 'exception_notification'
gem 'exception_notification_telegram'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install exception_notification_telegram
## Usage
In order to receive exceptions in Telegram, you need to create a [Telegram Channel](https://telegram.org/tour/channels) and a [Telegram Bot](https://core.telegram.org/bots). Then, add the bot to the channel from the Telegram app.To configure it, you need to set the channel name and the bot token, like this:
```ruby
Rails.application.config.middleware.use ExceptionNotification::Rack,
email: {
email_prefix: '[PREFIX] ',
sender_address: %{"notifier" },
exception_recipients: %w{[email protected]}
},
telegram: {
token: 'TELEGRAM-TOKEN',
channel: '@channel_name'
}
```## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/iaguirre88/exception_notification_telegram. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## Code of Conduct
Everyone interacting in the ExceptionNotificationTelegram project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/iaguirre88/exception_notification_telegram/blob/master/CODE_OF_CONDUCT.md).