#telegram-bot #game #cli #russian-roulette

bin+lib rustacean-roulette

A simple Russian Roulette Telegram bot implemented in Rust

3 releases

Uses new Rust 2024

new 0.1.2 Apr 11, 2025
0.1.1 Apr 2, 2025
0.1.0 Apr 1, 2025

#142 in Games

Download history 213/week @ 2025-03-30 136/week @ 2025-04-06

349 downloads per month

MIT license

30KB
598 lines

rustacean-roulette

🦀 A simple Russian Roulette Telegram bot implemented in Rust.

Installation

Using binstall

cargo binstall rustacean-roulette

Downloading from Releases

Navigate to the Releases page and download respective binary for your platform. Make sure to give it execute permissions.

Compiling from Source

cargo install rustacean-roulette

Configuration

The configuration file is in TOML format, and it could be placed anywhere you want. An example configuration file is provided below:

token = "" # Telegram bot token, required

[game] # Game configuration, optional
chambers = 6 # Number of chambers in the revolver
bullets = 2 # Number of bullets in the revolver
jam_probability = 0.05 # Probability of the gun getting jammed
min_mute_time = 60 # Minimum mute time in seconds
max_mute_time = 600 # Maximum mute time in seconds

[[groups]] # Whitelisted groups and override configuration
id = 0 # Group ID, required
# Override configuration, identical to game configuration
chambers = 8 # In this group, the revolver has 8 chambers
bullets = 3 # In this group, the revolver has 3 bullets
# ...etc.

[[groups]] # Another group
id = 1 # Group ID, required
# ...Override configuration

# More groups...

Usage

rustacean-roulette /path/to/config.toml

Where /path/to/config.toml is the path to your configuration file. Defaults to ./config.toml if not specified.

TODO

  • Random bullets number
  • /help

Dependencies

~7–22MB
~230K SLoC