This project is a Telegram bot that uses Telegraf
and @polkadot/api
. This README provides steps for setting up and running the bot on your own system.
-
Node.js: Ensure you have the latest version of Node.js installed. You can download it from nodejs.org.
-
npm: This will be installed alongside Node.js and is used for managing packages.
-
Clone the Repository
First, clone the repository to your local machine:
git clone https://github.com/username/repository-name.git
Replace
username/repository-name
with the actual repository name. -
Navigate to the Project Directory
cd repository-name
-
Install Dependencies
Make sure you are in the correct directory and run the following command:
npm install
-
Create a
.env
FileIn the root directory of the project, create a
.env
file and add your sensitive information:DB_HOSTNAME=your-database-hostname DB_USER=your-database-username DB_PASSWORD=your-database-password DB_DATABASE=your-database-name TELEGRAM_TOKEN=your-telegram-bot-token GRAPHICS_SOURCE=https://cdn.jsdelivr.net/gh/galacticcouncil/intergalactic-asset-metadata@latest/assets/ HYDRATION_LOGO=./Assets/default/Hydration-Watcher.png
Ensure that the
.env
file is added to.gitignore
to prevent it from being versioned in the repository. -
Check
package.json
Verify that all required packages are listed in
package.json
.
-
Start the Bot
Use the following command to start the bot:
npm start
If you have set up a start script in
package.json
,npm start
will run the bot. -
Stop the Bot
If you need to stop the bot, you can use:
Ctrl + C
Alternatively, if the bot is running on a server, you may use
SIGINT
orSIGTERM
to stop it gracefully.
-
Dependency Installation Issues: Check if you have the correct versions of Node.js and npm. You can try:
npm cache clean --force rm -rf node_modules npm install
-
Errors During Startup: Ensure your
.env
file is correctly configured and all required packages are installed. -
Database or API Connection Errors: Check that your
.env
values are correct and that the database and API are accessible.
If you wish to contribute to the project, please create a pull request on GitHub. Ensure your changes are well-tested and do not negatively impact existing functionality before submitting.