Skip to content

hammadbtc/bitcoin-block-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitcoin Block Bot

Discord bot that pings when a new Bitcoin block is mined — perfect for tracking mints, stuck transactions, or just staying dialed into the chain.

Features

  • Live block pings — notification each time a block is mined
  • Rich embed — block #, transactions, size, weight, mining pool, fee stats
  • Toggle on/off/blockwatch on / /blockwatch off per channel
  • Mempool fee rates — shows current high/med/low sat/vB alongside each block
  • Multi-channel — can be active in multiple channels simultaneously
  • Self-cleaning — auto-removes channels it can no longer send to
  • Admin-only control — only users with Administrator can toggle

Commands

/blockwatch

Options:

  • actionon or off

Turns block notifications on/off in the current channel. When on, the bot pings every time a new Bitcoin block is mined (~10 min average).

/blockwatch on   → 🟢 Block watch is ON
/blockwatch off  → 🔴 Block watch is OFF

Block Notification Embed

Each ping includes:

Field Source
Block # mempool.space
Transactions mempool.space
Size (MB) mempool.space
Weight (MWU) mempool.space
Mining Pool mempool.space
Avg Fee mempool.space
Median Fee mempool.space
Fee Rates (high/med/low) mempool.space fee API
Block Hash mempool.space (footer)

Quick Start

cp .env.example .env
npm install
npm run register
npm start

Fill .env with:

  • DISCORD_TOKEN
  • DISCORD_CLIENT_ID
  • DISCORD_GUILD_ID (optional, for guild-only command registration)

How It Works

  • Polls mempool.space/api/blocks/tip/height every 20 seconds
  • On first start, seeds the current height (no notification)
  • When height changes → fetches block details + fee rates → sends embed
  • Poller auto-starts when first channel enables watch, stops when last channel disables

Bot Permissions Required

  • Send Messages
  • Embed Links
  • applications.commands scope

License

Private project

About

Discord bot that pings when a new Bitcoin block is mined — with on/off toggle

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors