Skip to content

Repository files navigation

🤖 Jerry Bot — TMM Web3 Assistant

Dual-platform AI bot for Telegram and Discord.
Wallet collection · Transaction tracking · Mint detection · Scam alerts


⚡ Quick Setup

Step 1 — Install

npm install
cp .env.example .env

Step 2 — Fill in your .env file (see guides below)

Step 3 — Run

npm start

📱 TELEGRAM SETUP — BotFather Guide

This is how you create your bot and get the token.

1. Open Telegram and search for @BotFather

2. Send: /newbot

3. BotFather asks: "What name do you want for your bot?" → Type: Jerry

4. BotFather asks: "What username? Must end in 'bot'" → Type something like: JerryTMMBot or Jerry_Web3Bot

5. BotFather gives you a token like:

7123456789:AAHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

→ Copy this into your .env as TELEGRAM_BOT_TOKEN

6. Set Jerry's commands (so they show in the menu): Send this to BotFather:

/setcommands

Select your bot, then paste:

start - Start Jerry
stop - Pause Jerry
collect - Submit your wallet address
mywallet - View your wallet on file
track - Track a wallet's transactions
untrack - Stop tracking a wallet
txns - View recent transactions
wallets - List all wallets (admin)
export - Export wallets CSV (admin)
clear - Reset conversation
help - Full command list

7. (Optional) Set a profile photo: /setuserpic in BotFather → upload a Jerry/TMM image

8. Add Jerry to a group:

  • Open the group → tap group name → Add Members → search your bot username
  • Make Jerry an admin if you want it to read all messages (not just replies)

🎮 DISCORD SETUP — Developer Portal Guide

This creates the Discord bot and adds it to your server for testing.

1. Go to: https://discord.com/developers/applications

2. Click: New Application → Name it Jerry → Create

3. Go to the Bot tab (left sidebar)

  • Click Add BotYes, do it!
  • Under Token → click Reset Token → copy it → Paste into .env as DISCORD_BOT_TOKEN

4. Enable required permissions (still in Bot tab): Scroll down to Privileged Gateway Intents and turn ON:

  • Message Content Intent
  • Server Members Intent
  • Presence Intent (optional)

→ Click Save Changes

5. Generate your invite link:

  • Go to OAuth2URL Generator (left sidebar)
  • Under Scopes, tick: bot
  • Under Bot Permissions, tick:
    • Send Messages
    • Read Messages / View Channels
    • Read Message History
    • Attach Files (for CSV export)
    • Mention Everyone (optional)
  • Copy the generated URL at the bottom

6. Invite Jerry to your server:

  • Open the copied URL in browser
  • Select your test server → Authorize
  • Jerry will appear in your member list as offline until you run npm start

7. Test Jerry in Discord:

!jerry start
!jerry help
!jerry collect 0xYourWalletAddress
@Jerry what is DeFi?

🔑 API Keys — Where to Get Them

Key Where Free?
GEMINI_API_KEY aistudio.google.com/apikey Free tier + paid
TELEGRAM_BOT_TOKEN @BotFather on Telegram Free
DISCORD_BOT_TOKEN discord.com/developers Free
ETHERSCAN_API_KEY etherscan.io/apis Free (5 calls/sec)
BSCSCAN_API_KEY bscscan.com/apis Free
POLYGONSCAN_API_KEY polygonscan.com/apis Free
BASESCAN_API_KEY basescan.org/apis Free
ARBISCAN_API_KEY arbiscan.io/apis Free

Note: All block explorer free tiers are more than enough for this bot.


💬 Command Reference

Telegram Commands

Command Description
/start Start Jerry
/stop Pause Jerry
/collect 0xAddress Submit wallet for allowlist/airdrop
/mywallet View your submitted wallet
/track 0xAddr eth Track wallet transactions (real-time)
/untrack 0xAddr Stop tracking a wallet
/txns 0xAddr eth View last 3 transactions
/wallets (Admin) List all collected wallets
/export (Admin) Download wallets as CSV
/clear Reset conversation memory
/help Full command list

Discord Commands (prefix: !jerry)

Same as above but prefix with !jerry :

!jerry collect 0xYourAddress
!jerry track 0xAddr polygon
!jerry txns 0xAddr base

Or mention: @Jerry what's an NFT?

Supported Chains

eth · bsc · polygon · base · arbitrum


🔒 Security Features

  • Rate limiting — 10 messages per minute per user
  • Address validation — only accepts valid 0x EVM addresses
  • Scam detection — flags phishing patterns automatically
  • Input sanitization — strips HTML/injection attempts
  • Admin-only commands — wallet export/list restricted by user ID
  • No private keys — Jerry never asks for or stores seed phrases
  • Mint safety alerts — warns users to verify contracts before minting

🚀 Deployment (Free Hosting)

Railway (Recommended)

1. Push this folder to GitHub
2. Go to railway.app → New Project → Deploy from GitHub
3. Add all .env variables in Railway dashboard
4. Deploy → runs 24/7 automatically

Render

1. Push to GitHub
2. render.com → New Web Service → connect repo
3. Build: npm install | Start: npm start
4. Add env vars → Deploy

VPS / Local (persistent)

npm install -g pm2
pm2 start index.js --name jerry
pm2 save && pm2 startup

🗂 File Structure

jerry-bot/
├── index.js          ← Entry point
├── telegram.js       ← Telegram bot + all commands
├── discord.js        ← Discord bot + all commands
├── claude.js         ← AI brain (Gemini API)
├── systemPrompt.js   ← Jerry's personality
├── walletStore.js    ← Wallet collection + CSV export
├── tracker.js        ← Multi-chain tx tracker
├── mintDetector.js   ← Auto mint link detection
├── security.js       ← Rate limit, validation, scam filter
├── data/
│   └── wallets.json  ← Persisted wallet addresses
├── .env.example
├── package.json
└── README.md

Built for the TMM crew. Stay safe out there. 🔒🧁

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages