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 🙏

© 2024 – Pkg Stats / Ryan Hefner

xstro

v1.1.9

Published

A simple WhatsApp bot built by AstroX11.

Downloads

285

Readme

WhatsApp Bot In Javascript Baileys Web API

npm


SETUP

Fork the Repo

First, fork your own copy of the repo to your GitHub account.

FORK REPO

Get a Session

Get the Session ID from the render server.

GET SESSION


NOTICE

I’m not responsible for you messing around and getting your account banned. As long as you don’t modify the source code to fit your idiotic needs, you’re fine. Seriously, don’t spam others—I'm tired of repeating this.


NODE JS DEPLOYMENT PLATFORMS

Render Support

1. Account Setup and BetterStack

Xstro fully supports Render. To deploy Xstro on Render without errors and timeouts:

BetterStack ensures the bot stays alive. Don’t ask, “Why is my bot dead after 5 mins on Render?”—this is why.

2. Database URL Setup (Optional)

PostgreSQL Database (Optional):

  • Useful if you prefer a faster database instead of local Sqlite3.
  • Prevents loss of session and configurations on redeployment.
  • Acquire the database URL from the Render Dashboard.

3. Blueprint Deployment on Render

Thanks to GitHub Actions, all Docker builds are tested and successful.


Heroku Support, Deployments, Dynos & Warnings

1. Create a Heroku Account

Create a Heroku Account and add your credit card details. Use eco dynos to save money.

2. Xstro App Setup

Ensure Xstro is built as a Heroku Container.

  • Deploy to Heroku.
  • Fill variables correctly. Wrong configs = runtime failure. Don’t blame me.

3. Important

Choose worker as the runtime. If you pick web, the application will crash—Heroku’s issue, not mine.


Koyeb Deployment

I have no idea—Koyeb banned me.


Official Panel Support

Xstro now supports panel deployment.

  • Create an index.js file at the root of your panel.
  • Add variables in the correct format (SESSION_ID: 'Xstro_something').
  • Run the script below to install and start Xstro:
const { existsSync, writeFileSync } = require('node:fs');
const { spawnSync } = require('node:child_process');
const path = require('node:path');

const CONFIG = {
	SESSION_ID: '', // Put your Session ID Here kid!
	PROJECT_DIR: 'Xstro',
	REPO_URL: 'https://github.com/AstroX11/Xstro.git',
	APP_NAME: 'Xstro',
	MAIN_SCRIPT: 'index.js',
};

function handleError(message, error) {
	console.error(message, error);
	process.exit(1);
}

function cloneRepository() {
	console.log('Cloning repository...');
	const cloneResult = spawnSync('git', ['clone', CONFIG.REPO_URL, CONFIG.PROJECT_DIR], { stdio: 'inherit', shell: true });
	if (cloneResult.error || cloneResult.status !== 0) handleError('Failed to clone repository.', cloneResult.error);
}

function writeEnvFile() {
	try {
		writeFileSync(path.join(CONFIG.PROJECT_DIR, '.env'), `SESSION_ID=${CONFIG.SESSION_ID}`);
	} catch (error) {
		handleError('Failed to write .env file', error);
	}
}

function installDependencies() {
	console.log('Installing dependencies...');
	const installResult = spawnSync('yarn', ['install'], { cwd: path.resolve(CONFIG.PROJECT_DIR), stdio: 'inherit', shell: true });
	if (installResult.error || installResult.status !== 0) handleError('Failed to install dependencies.', installResult.error);
}

function startApplication() {
	console.log('Starting application...');
	const startResult = spawnSync('pm2', ['start', CONFIG.MAIN_SCRIPT, '--name', CONFIG.APP_NAME, '--attach'], {
		cwd: path.resolve(CONFIG.PROJECT_DIR),
		stdio: 'inherit',
		shell: true,
	});
	if (startResult.error || startResult.status !== 0) handleError('Failed to start the application.', startResult.error);
}

function XstroPanel() {
	if (!existsSync(CONFIG.PROJECT_DIR)) cloneRepository();
	writeEnvFile();
	installDependencies();
	startApplication();
}

XstroPanel();

Warning: Don’t change any code—just add your Session ID and run the bot.


WINDOWS SUPPORT

1. Install Node.js

Download Node.js v22.12.0 here. Restart your PC after installation.

2. Installation

Install Git, then paste the following commands in PowerShell:

npm i -g pm2 yarn
git clone https://github.com/AstroX11/Xstro.git
cd Xstro
yarn install

3. Configuration

If you don’t trust the terminal, create a .env file manually and paste:

SESSION_ID=null
CMD_REACT=true
BOT_INFO=Astro;Xstro-Md;
MODE=private
AUTO_STATUS_READ=false
AUTO_READ=false
STICKER_PACK=Astro;Xstro
PREFIX=./,

4. Start the Bot

npm start

5. Stop the Bot

npm stop

CONTRIBUTING

Want to help? Fork the repo and create a pull request. Don’t break anything.

Contribute

Join WhatsApp Group