Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Dice

A simple Telegram bot that automatically rolls dice, stores results, and calculates the average score on request.

Built with Node.js and node-telegram-bot-api.


✅ Features

  • 🎲 Automatically rolls dice every few seconds
  • 📥 Stores all dice values in an array
  • 📊 Shows roll count, total sum & average
  • ▶️ /start — begin auto dice rolling
  • /stop — stop rolling & show final stats
  • 📈 /result — instantly view current stats

📦 Requirements


🔧 Installation

git clone <repo-url>
cd dice
npm install

Create a .env file:

BOT_TOKEN=your_telegram_bot_token_here

🚀 Start the bot

node index.js

🧠 How it works

  • Bot uses setInterval() to roll dice continuously
  • Each result is pushed into an array
  • /result or /stop calculates:
    • total rolls
    • sum of values
    • average value

📁 Project Structure

dice/
├─ index.js
├─ .env
├─ package.json
└─ node_modules/

✅ Example Commands

Command Description
/start Start auto dice rolling
/result Show stats & average
/stop Stop and display final results

📝 License

Free to use, modify, and improve 🎯


Happy rolling! 🎲😄

About

A Telegram bot that automatically rolls dice and calculates the average of the results.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages