🚀 MoonShot Bot is a Telegram bot built to help users track trending cryptocurrency tokens and their market data, including price, volume, and more, using the GeckoTerminal API.
- Features
- Prerequisites
- Setup
- Environment Variables
- Folder Structure
- Usage
- Available Commands
- Deployment
- Contributing
- License
- Fetches real-time market data for specified cryptocurrency pools.
- Displays information such as price, volume, market cap, and price changes.
- Rate limiting to prevent spamming.
- Easily configurable and secure with environment variables.
- Node.js (v14 or higher): Download and install Node.js
- Telegram Bot Token: Obtain a token by creating a bot on Telegram using BotFather.
- GeckoTerminal API: You’ll need access to the GeckoTerminal API.
-
Clone the repository:
git clone https://github.com/yourusername/moonshot-telegram-bot.git cd moonshot-telegram-bot
-
Install dependencies:
npm install
-
Create Environment Variables:
- Create a
.env
file in the root directory and add your API keys (see Environment Variables for details).
- Create a
In your project root, create a .env
file to securely store sensitive information:
- TELEGRAM_TOKEN=your_telegram_bot_token
- GECKO_API_BASE_URL=https://api.geckoterminal.com/api/v2
##Folder Structure
moonshot-telegram-bot/
├── src/
│ ├── commands.js # Contains bot command handlers
│ ├── config.js # Loads environment variables and performs basic checks
│ ├── fetchData.js # Contains functions to fetch data from GeckoTerminal API
│ └── index.js # Main server and bot initialization
└── .env # Environment variables file
└── README.md # Project documentation
##Usage
- Run the bot locally:
node src/index.js
- Start interacting with the bot on Telegram:
Open Telegram and search for your bot by username. Use the commands listed below to start fetching cryptocurrency data.
##Available Commands Command Description /start Start the bot and receive a welcome message. /call_moonshot Fetch and display data for trending tokens. /join_community Provides a link to join the Telegram community. /trade_moonshots Provides a link to start trading MoonShots.
##Deployment To deploy the bot on a server:
- Ensure that your server has Node.js installed.
- Clone the repository and set up environment variables on the server.
- Use a process manager like PM2 to keep the bot running:
pm2 start src/index.js --name moonshot-telegram-bot
##Contributing
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
- Make your changes and commit:
git commit -m "Description of changes"
- Push to the branch:
git push origin feature-branch
- Create a pull request.
##License This project is licensed under the MIT License. See the LICENSE file for details.
This `README.md` file provides a structured, step-by-step guide for users and contributors. Let me know if there are further modifications you’d like!