Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

telegram_simple_messenger

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

telegram_simple_messenger

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

TelegramSimpleMessenger

It's a simple gem to send messages through Telegram to a user or a group/channel.

What do you need?

To use it, you need and Telegram API KEY (a bot key) and a Chat ID.

API KEY

The API KEY you can get building a new bot through @BotFather. Just send a Telegram message to @BotFather and follows the instructions. An API KEY looks like this: 5490951233:AAFZH99VRQuIOH-qweL1fwATf3kna2eBQSE.

CHAT ID

Use another Telegram Bot @RawDataBot to find your own Chat ID or a group/channel Chat ID.

Installation

Add to your Gemfile

gem "telegram_simple_messenger", github: "shayani/telegram_simple_messenger"

Then run

bundle install

Configuration

Create a initializer file to set the default API KEY and CHAT ID

# config/initializers/telegram_simple_messenger.rb

TelegramSimpleMessenger.default_api_key=MY_API_KEY
TelegramSimpleMessenger.default_chat_id=MY_CHAT_ID

Usage

Sending a message using the default API KEY and CHAT ID

Simple call the service:

TelegramSimpleMessenger.send_message("Hello world!")

Overwriting the API KEY and/or CHAT ID

You can overwrite the default API KEY and CHAT ID passing them as arguments:

TelegramSimpleMessenger.send_message("Hello world!", ANOTHER_API_KEY, ANOTHER_CHAT_ID)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/telegram_simple_messenger.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 22 May 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc