{"id":19310966,"url":"https://github.com/a0s/telegram-loggerbot-ruby","last_synced_at":"2025-06-12T19:06:11.347Z","repository":{"id":59157422,"uuid":"80014746","full_name":"a0s/telegram-loggerbot-ruby","owner":"a0s","description":"Allows to send event logs directly to the Telegram chat","archived":false,"fork":false,"pushed_at":"2017-02-13T11:54:45.000Z","size":299,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-03T01:41:22.225Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/a0s/telegram-loggerbot-ruby","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a0s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-25T13:00:22.000Z","updated_at":"2023-07-02T02:24:37.000Z","dependencies_parsed_at":"2022-09-13T20:11:03.280Z","dependency_job_id":null,"html_url":"https://github.com/a0s/telegram-loggerbot-ruby","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/a0s/telegram-loggerbot-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Ftelegram-loggerbot-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Ftelegram-loggerbot-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Ftelegram-loggerbot-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Ftelegram-loggerbot-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a0s","download_url":"https://codeload.github.com/a0s/telegram-loggerbot-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Ftelegram-loggerbot-ruby/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259519776,"owners_count":22870365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T00:27:08.979Z","updated_at":"2025-06-12T19:06:11.317Z","avatar_url":"https://github.com/a0s.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Telegram::LoggerBot\n\n[![Build Status](https://travis-ci.org/a0s/telegram-loggerbot-ruby.svg?branch=master)](https://travis-ci.org/a0s/telegram-loggerbot-ruby)\n\nTelegram::LoggerBot allows to send event logs directly to the Telegram chat\n\n![preview1](https://github.com/a0s/telegram-loggerbot-ruby/raw/master/img/preview1.jpg)![preview2](https://github.com/a0s/telegram-loggerbot-ruby/raw/master/img/preview2.jpg)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'telegram-loggerbot-ruby'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install telegram-loggerbot-ruby\n\n##Usage\n\n  1. Create new bot with @BotFather and get his TOKEN\n  2. Write something to the new bot (!!!)\n  3. Obtain your TELEGRAM_USER_ID from, for example, @get_id_bot\n\nRequire it to your code:\n\n```ruby\nrequire 'telegram/loggerbot'\n```\n\nInitialize with obtained TOKEN and TELEGRAM_USER_ID: \n\n```ruby\nTelegram::LoggerBot.configure do |config|\n    config.token = TOKEN                                 # required\n    config.chat_id = USER_ID_OR_CHAT_ID                  # required\n    config.enabled = false                               # optional, true by default\n    config.level = Logger::INFO                          # optional, default is Logger::DEBUG\n    config.next_logger = App.existing_logger_instance    # optional\n    config.api = App.existing_telegram_bot_api_instance  # optional\nend\n\nlogger = Telegram::LoggerBot.new\n```\n\nor in classic style:\n\n```ruby\nlogger = Telegram::LoggerBot.new(\n    token: TOKEN,                                 # required\n    chat_id: USER_ID_OR_CHAT_ID,                  # required\n    enabled: false,                               # optional, true by default\n    level: Logger::INFO,                          # optional, default is Logger::DEBUG\n    next_logger: App.existing_logger_instance,    # optional\n    api: App.existing_telegram_bot_api_instance   # optional\n)\n```\n\nYou can pass events through LoggerBot to any other logger:\n\n```ruby\nexisting_logger = Logger.new(STDOUT)\nlogger = Telegram::LoggerBot.new(..., next_logger: existing_logger)\n``` \n\nLog you events:\n\n```ruby\nlogger.debug('MyProgram') { \"Text of some errors\" }\nlogger.info('MyProgram') { \"Text of some errors\" }\nlogger.warn('MyProgram') { \"Text of some errors\" }\nlogger.error('MyProgram') { \"Text of some errors\" }\nlogger.fatal('MyProgram') { \"Text of some errors\" }\n```\n\n## Development\n\nAfter 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.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa0s%2Ftelegram-loggerbot-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa0s%2Ftelegram-loggerbot-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa0s%2Ftelegram-loggerbot-ruby/lists"}