https://github.com/byteholic/teleplate
  
  
    Telegram Bot Template with Grammy & Hono 
    https://github.com/byteholic/teleplate
  
bot-template grammy grammyjs hono honojs telegram telegram-bot-template
        Last synced: 4 months ago 
        JSON representation
    
Telegram Bot Template with Grammy & Hono
- Host: GitHub
 - URL: https://github.com/byteholic/teleplate
 - Owner: ByteHolic
 - Created: 2023-09-03T19:43:43.000Z (about 2 years ago)
 - Default Branch: main
 - Last Pushed: 2025-07-08T10:35:48.000Z (4 months ago)
 - Last Synced: 2025-07-12T01:31:51.378Z (4 months ago)
 - Topics: bot-template, grammy, grammyjs, hono, honojs, telegram, telegram-bot-template
 - Language: TypeScript
 - Homepage:
 - Size: 29.3 KB
 - Stars: 14
 - Watchers: 1
 - Forks: 2
 - Open Issues: 0
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
README
          🤖 Teleplate
Bot starter template based on [grammY](https://grammy.dev/) bot framework.
## Features
- Scalable structure
- Config loading and validation
- Internationalization, language changing
- Graceful shutdown
- Logger (powered by [pino](https://github.com/pinojs/pino))
- Ultrafast and multi-runtime server (powered by [hono](https://github.com/honojs/hono))
## Usage
Follow these steps to set up and run your bot using this template:
1. **Create a New Repository**
    Start by creating a new repository using this template. You can do this by clicking [here](https://github.com/byteholic/teleplate/generate).
2. **Environment Variables Setup**
    Create an environment variables file by copying the provided example file:
     ```bash
     cp .env.example .env
     ```
    Open the newly created `.env` file and set the `BOT_TOKEN` environment variable.
3. **Launching the Bot**
    You can run your bot in both development and production modes.
    **Development Mode:**
    Install the required dependencies:
    ```bash
    bun install
    ```
    Start the bot in watch mode (auto-reload when code changes):
    ```bash
    bun run dev
    ```
   **Production Mode:**
    Install only production dependencies:
    ```bash
    bun install --only=prod
    ```
    Set `DEBUG` environment variable to `false` in your `.env` file.
    Start the bot in production mode:
    ```bash
    bun run start:force # skip type checking and start
    # or
    bun start # with type checking (requires development dependencies)
    ```
### List of Available Commands
- `bun run dev` — Start the bot in development mode.
### Directory Structure
```
project-root/
  ├── locales                         # Localization files
  └── src                             # Codes
      ├── common                      # Common Files like Custom Context
      ├── helpers                     # Helper functions
      ├── middlewares                 # Bot middlewares
      ├── modules                     # bot Modules
      │   ├── example                 # Module Name
      │   │   ├── example.module.ts   # Get updates
      │   │   └── example.service.ts  # Answer updates 
      │   ├── somthing                # other modules
      ├── bootstrap.ts                # bot entry point
      └── index.ts                    # Application entry point
```