💎 Cube Worlds Bot 💎
Cube Worlds game inside Telegram bot.
- Scalable structure
- Config loading and validation
- Internationalization, language changing
- Graceful shutdown
- Logger (powered by pino)
- Fast and low overhead server (powered by fastify)
Follow these steps to set up and run your bot using this template:
-
Create a New Repository
Start by creating a new repository using this template. You can do this by clicking here.
-
Environment Variables Setup
Create an environment variables file by copying the provided example file:
cp .env.example .env
Open the newly created
.env
file and set theBOT_TOKEN
environment variable. -
Launching the Bot
You can run your bot in both development and production modes.
Development Mode:
Install the required dependencies:
npm install
Start the bot in watch mode (auto-reload when code changes):
npm run dev
Production Mode:
Install only production dependencies (no development dependencies):
npm install --only=prod
Set the
NODE_ENV
environment variable to "production" in your.env
file. Also, make sure to updateBOT_WEBHOOK
with the actual URL where your bot will receive updates.NODE_ENV=production BOT_WEBHOOK=<your_webhook_url>
Start the bot in production mode:
npm start # or npm run start:force # if you want to skip type checking
npm run lint
— Lint source code.npm run format
— Format source code.npm run typecheck
— Run type checking.npm run dev
— Start the bot in development mode.npm run start
— Start the bot.npm run start:force
— Starts the bot without type checking.npm run update
— Update all dependencies.