Socket
Book a DemoInstallSign in
Socket

rubydium

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rubydium

0.4.10
bundlerRubygems
Version published
Maintainers
1
Created
Source

What it is

Rubydium is a framework for building Telegram bots. Built on top of telegram-bot-ruby API wrapper, it aims to provide tools for building your bots with minimum boilerplate.

It's far from being done, but all the code in the examples directory is functional and mostly covered with specs.

Installation

CLI tool for creating and setting up new projects is planned. For now:

  • Create your project: mkdir example_bot && cd example_bot
  • Install the gem:
  • Add this gem to the Gemfile: bundle init && echo 'gem "rubydium"' >> Gemfile bundle install
  • Or install system-wide: gem install rubydium
  • Create your main file: touch example_bot.rb
  • See the examples directory for bot examples.

Configuring the bot

There's two main ways to write your config. With a block:

ExampleBot.configure do |config|
  config.token = "1234567890:long_alphanumeric_string_goes_here"
  config.bot_username = "ends_with_bot"
  config.owner_username = "thats_you"
  config.privileged_usernames = %w[
    your_friend your_chat_moderator
  ]
end

Or with a hash:

ExampleBot.config = {
  token: "1234567890:long_alphanumeric_string_goes_here",
  bot_username: "ends_with_bot",
  owner_username: "thats_you",
  privileged_usernames: %w[
    your_friend your_chat_moderator
  ]
}

The hash variant also means you can pass in any valid Ruby hash, regardless of where it comes from. For example, you can set the same values, if you parse

a JSON file:

example_bot/config.json:

{
  "token": "1234567890:long_alphanumeric_string_goes_here",
  "bot_username": "ends_with_bot",
  "owner_username": "thats_you",
  "privileged_usernames": [
    "your_friend",
    "your_chat_moderator"
  ]
}

example_bot/example_bot.rb:

require "json"
ExampleBot.config = JSON.load_file("./config.json")
or a YAML:

example_bot/config.yaml

token: 1234567890:long_alphanumeric_string_goes_here
bot_username: ends_with_bot
owner_username: thats_you
privileged_usernames:
- your_friend
- your_chat_moderator

example_bot/example_bot.rb:

require "yaml"
ExampleBot.config = YAML.load_file("./config.yaml")

FAQs

Package last updated on 29 Jun 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.