Development of Discord Bot for Crypto Community
A crypto community in Discord—not just a chat. It's infrastructure: holder verification, price alerts, protocol news, whitelist management, trading signals. Without automation, admin load grows linearly with community size: 10,000 participants and no bot—hours each day of manual holder verification and answering the same questions about price.
Key Functions of a Crypto Bot
NFT/Token Holder Verification
The most demanded function: confirm that a Discord user is an NFT or token holder and issue the corresponding role. Standard flow: user types /verify, bot generates a unique nonce, user signs it via MetaMask on the verification page, site passes the signature to the bot, bot checks the signature and on-chain balance.
Key detail: the signature must include Discord user ID in the message—otherwise one wallet can verify multiple Discord users. Balance check: balanceOf(address) for ERC-20/ERC-721 or balanceOfBatch for ERC-1155 via Alchemy/Infura RPC. Updating roles on token sale—background task checking balances every 24 hours.
Price Alerts and Price Commands
/price ETH → current price from CoinGecko API + 24h change. Custom threshold alert: user sets alert ETH > $3000, bot DM notifies. Implementation: cron job every 5 minutes, Redis for subscription storage, Discord webhook for notifications.
For DeFi protocols with their own token—price from DEX directly via Uniswap v3 subgraph (The Graph) or slot0() call to the pool. This is more current than CoinGecko for small-cap tokens with no CEX listing.
News Notifications
RSS feed or webhook from protocol → formatted embed in #announcements channel. For on-chain events: subscribe via WebSocket to node on Transfer, Mint, Burn events of the contract. Large transfer (whale alert) → automatic post in #whale-alerts.
Technical Stack
Discord.js v14—main library. Slash commands via CommandBuilder, interactions via InteractionCreate event. Slash commands vs. prefix commands: slash commands are mandatory since 2023—Discord disabled message content intent for unprivileged bots.
Node.js backend with viem for on-chain queries. viem preferable to ethers.js for bots: better tree-shaking, type safety, smaller bundle size.
Redis for storing verification nonces (TTL 10 minutes), user alerts, rate-limit counters.
PostgreSQL for long-term storage: Discord ID → wallet address mapping, verification history.
Timeline and Process
Basic bot with prices and verification: 3–5 days. Full-featured with whale alerts, whitelist management, on-chain monitoring: 1–2 weeks. Cost is calculated individually.







