A Discord bot that allows you to get the current Gas for cryptocurrency markets using Slash commands.
To run this project, you'll need to have:
- Deno (version 1.34.3 or newer)
- A Discord bot token, which you can get by creating a bot on the Discord Developer Portal
- Discord.js 14
- Typescript
- An environment variable file (.env) for your bot token
- Clone this repository:
git clone https://github.com/ziko3000/Fear-and-Greed-Index](https://github.com/ziko3000/GasTracker
- Change into the cloned repository:
cd your-repo-name
- Create an .env file in the root of your project and insert your bot token:
BOT_TOKEN=YourDiscordBotToken
APPLICATION_ID=YourApplicationId
ETHERSCAN_API_KEY = YourEtherscanAPIkey
- Run the bot:
deno task run_bot
PM2 is a process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever and reload them without downtime. It's perfect for production environments. Here are the steps to install it:
To install PM2 globally (available to all your Node.js/Deno projects), you can run:
npm install -g pm2
If you're facing permission issues, you may need to prepend sudo:
sudo npm install -g pm2
Congratulations! You've successfully installed PM2 on your Linux machine. Now, you can use the pm2 command to run your bot:
pm2 start pm2_config.json
This bot supports the following Slash commands:
/gas
: Get Ethereum gas prices/help
: Get help about the bot and its commands.
To add a new command:
- Create a new command file in the
commands
folder, likemycommand.ts
. - Define your command as a class with
name
,description
, andexecute
method. - Import your command class in
CommandHandler.ts
and register it in the constructor.
For example:
import { MyCommand } from './mycommand';
// In CommandHandler constructor
this.registerCommand('mycommand', 'This is my command', (interaction) => new MyCommand().execute(interaction));
This project is licensed under the MIT License - see the LICENSE.md file for details.