npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

whatsapp-chess-bot

v1.0.4

Published

A WhatsApp bot that lets you play chess via interactive polls with an AI opponent

Readme

WhatsApp Chess Bot ♟️

A WhatsApp bot that lets you play chess against an AI opponent using interactive polls. The bot displays the chess board as images and uses polls for move selection.

Features

  • Play chess via WhatsApp polls
  • AI opponent powered by js-chess-engine
  • Visual chess board using chessboardimage.com
  • Automatic message cleanup (keeps only last 2 board images)
  • Choose piece type, then select specific move

Installation

npm install whatsapp-chess-bot

Or clone and run:

git clone https://github.com/Davdadev/whatsapp-chess-bot.git
cd whatsapp-chess-bot
npm install
npm start

Setup

  1. Run the bot:

    npm start
  2. Scan the QR code with WhatsApp (Link Device)

  3. Bot is ready! Send commands in any WhatsApp chat.

Commands

  • @chess start - Start a new chess game
  • @chess clean - Delete all bot images from chat

How to Play

  1. Send @chess start in any WhatsApp chat
  2. The bot shows the current board position
  3. Vote in the "Choose a piece type" poll (Pawn, Knight, Bishop, etc.)
  4. Vote in the move poll to select your piece's destination
  5. The AI responds automatically
  6. Repeat until checkmate or stalemate

Configuration

Edit index.js to customize:

  • AI Difficulty: Change engine.aiMove(gameData.game.fen(), 2) - the 2 is the search depth (higher = stronger)
  • Max Images: Change enforceMaxImages(chatId, 2) - default keeps 2 board images
  • Session Name: Change clientId: "chess-poll-session" for multiple instances

Requirements

  • Node.js 14 or higher
  • WhatsApp account
  • Internet connection

Dependencies

  • whatsapp-web.js - WhatsApp client
  • qrcode-terminal - QR code display
  • chess.js - Chess game logic
  • js-chess-engine - AI opponent

Notes

  • WhatsApp may prevent deletion of old messages depending on timing/permissions
  • For best experience, enable disappearing messages in the chat
  • Board images are fetched from https://chessboardimage.com/

License

GPL-3.0