A comprehensive cryptocurrency Discord bot that integrates with wallet daemons via RPC commands, stores data in MariaDB/MySQL database, and provides a full suite of wallet management features for Discord servers.
- Latest Package Versions - All dependencies updated to their latest stable versions
- Enhanced Storage System - Updated lowdb v7 with improved performance and async/await patterns
- Better Error Handling - More robust error handling and logging throughout
- Improved Performance - Optimized database connections and API calls
- Modern JavaScript - Enhanced async/await patterns and ES module compatibility
- Updated for Node.js 18+ - Compatible with the latest Node.js versions
- Discord.js v14 - Updated to use the latest Discord.js library with modern intents system
- Enhanced Wallet Support - Improved compatibility with newer wallet versions
- Better Error Handling - More robust error handling and logging
- Modern Dependencies - All dependencies updated to their latest stable versions
- Improved Performance - Optimized database connections and API calls
- Node.js 18.0.0 or higher
- MariaDB/MySQL Database
- Discord Bot Token
- Cryptocurrency Wallet Daemon with RPC enabled
-
Clone the repository
git clone https://github.com/yourusername/cryptocurrency-crypto-bot.git cd cryptocurrency-crypto-bot -
Install dependencies
npm install
-
Database Setup
- Create a MySQL/MariaDB database
- Import the
Cryptocurrency-crypto-bot.sqlfile
-
Configuration
- Copy
config.js.exampletoconfig.js - Edit
config.jswith your settings:- Discord bot token
- Database credentials
- Wallet RPC settings
- Bot permissions and channels
- Copy
-
Start the bot
npm start
For development:
npm run dev
+register | +r- Register an account with the bot+profile | +p- Display account information+balance | +b- Display your current balance+deposit | +d- Get your deposit address+withdraw <address> <amount> | +w <address> <amount>- Withdraw balance+tip <@username> <amount>- Tip a user from Discord+rain <all/online/random> <amount> <userCount>- Rain coins to multiple users+drop <phrase/react> <amount> <timeInSeconds> <phrase>- Create coin drops+history <deposits/withdrawals/payments>- View transaction history+stake <amount>- Convert balance to stake balance (if staking enabled)+unstake <amount>- Convert stake balance back to normal balance+update | +u- Update your username+donate- Show donation address+notify <on/off>- Enable/disable bot mentions+version | +v- Get bot and wallet information
+start / +stop- Enable/Disable all bot commands+getdeposits | +gd- Manually check for new deposits+creditdeposits | +cd- Manually credit confirmed deposits+getstakes | +gs- Manually check for stake transactions+creditstakes | +cs- Manually credit stakes to users+clear | +c- Delete visible messages from chat
The bot is highly configurable through the config.js file:
- Command prefix customization
- Admin/Moderator/VIP user roles
- Channel restrictions
- Cooldown settings
- Error logging
- RPC connection settings
- Transaction confirmation requirements
- Fee settings
- Explorer links
- Stake pool configuration
- Reward distribution
- Lock times and percentages
- CoinMarketCap integration
- CryptoCompare integration
- Price history logging
If you want to enable staking features:
-
Enable staking in your wallet configuration:
staking=1 walletnotify=/path/to/your/bot/folder/transaction.sh %s -
Make the transaction script executable:
chmod +x transaction.sh
-
Enable staking options in
config.js
A Dockerfile and docker-compose.yml can be created for easy deployment:
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]- Keep your
config.jsfile secure and never commit it to version control - Use environment variables for sensitive data in production
- Regularly update dependencies
- Monitor bot permissions and restrict to necessary channels
- Enable proper database security
The bot uses several tables:
user- User accounts and balancesdeposits- Deposit transactionswithdrawals- Withdrawal transactionspayments- Internal payments (tips, rain, drops)transactions- Wallet transactions for stakinglog- Activity loggingcoin_price_history- Price tracking (if enabled)
- discord.js: ^14.16.3 (Latest Discord API support)
- mysql2: ^3.11.4 (Latest MySQL driver with performance improvements)
- big.js: ^6.2.2 (Latest arbitrary precision arithmetic)
- moment-timezone: ^0.5.46 (Latest timezone handling)
- log4js: ^6.9.1 (Latest logging framework)
- lowdb: ^7.0.1 (Latest JSON database with async/await)
- bitcoin-core: ^4.2.0 (Latest Bitcoin RPC client)
- axios: ^1.7.9 (Latest HTTP client)
- nodemon: ^3.1.7 (Latest development tool)
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details
For support and questions:
- Check the configuration carefully
- Review the logs for error messages
- Ensure your wallet daemon is running and accessible
- Verify database connectivity
- Open an issue on GitHub
If upgrading from v2.0:
- Backup your database and configuration
- Run
npm installto update to latest packages - Test in a development environment first
- The storage system now uses async/await patterns
If upgrading from the original version:
- Backup your database
- Update Node.js to version 18+
- Update your
config.jsfile with new format - Run
npm installto update dependencies - Test in a development environment first
Note: This bot handles real cryptocurrency transactions. Always test thoroughly in a development environment before deploying to production.