Skip to content

DecartAI/decart-example-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decart Telegram Bot

A lean Telegram bot showcasing Decart AI models for image and video generation.

Demo

Decart.Telegram.Bot.Demo.mp4

Features

Send Get Model
Text message Generated image lucy-pro-t2i
image: prompt Generated image lucy-pro-t2i
video: prompt Generated video lucy-pro-t2v
Image + caption Animated video lucy-pro-i2v
Video + caption Edited video lucy-pro-v2v
Reply to image with text Edited image lucy-pro-i2i
Reply to video with text Edited video lucy-pro-v2v

No commands needed - the bot auto-detects what you want.

Prerequisites

  • Node.js 18+
  • Telegram Bot Token
  • Decart API Key

Setup

1. Clone and install

git clone https://github.com/DecartAI/decart-example-telegram-bot.git
cd decart-example-telegram-bot
npm install

2. Get a Telegram Bot Token

  1. Open Telegram and search for @BotFather
  2. Send /newbot
  3. Follow prompts to name your bot
  4. Copy the token provided

3. Get a Decart API Key

  1. Go to platform.decart.ai
  2. Sign up or log in
  3. Navigate to API Keys
  4. Create a new key and copy it

4. Configure environment

cp .env.example .env

Edit .env with your tokens:

TELEGRAM_BOT_TOKEN=your_telegram_token
DECART_API_KEY=your_decart_key

5. Run the bot

Development:

npm run dev

Production:
This example uses Vercel as the deployment target, follow grammY's hosting documentation to learn more.

Usage

Open your bot in Telegram and:

  1. Generate an image: Just type a description

    A cat astronaut floating in space

  2. Generate an image (explicit): Use the image: prefix

    image: A futuristic cityscape at sunset

  3. Generate a video: Use the video: prefix

    video: A cat walking through a garden

  4. Animate an image: Send a photo with a caption

    [photo] + "Make it come alive with gentle movement"

  5. Edit a video: Send a video with a caption

    [video] + "Transform into anime style"

  6. Edit generated content: Reply to any bot-generated image or video with new instructions

    Reply to image: "Add a sunset background"

Resources

About

A Telegram Bot using Decart's image & video models

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •