A Telegram bot for generating and scheduling posts with AI-generated text and images.
- Generate complete posts with AI-generated text and images
- Schedule posts for later publication
- Manage scheduled posts (list, cancel)
- Daily post limit to prevent overuse
- Node.js 14+
- Telegram Bot Token (from @BotFather)
- Gemini API Key (for text generation)
- Hugging Face API Key (for image generation)
- Optional: Telegram Channel ID (if you want to post to a channel)
- Clone this repository
- Install dependencies:
npm install - Create a
.envfile with your API keys:TELEGRAM_BOT_TOKEN=your_telegram_bot_token GEMINI_API_KEY=your_gemini_api_key HUGGINGFACE_API_KEY=your_huggingface_api_key CHANNEL_ID=your_channel_id_optional - Start the bot:
npm start
-
Create a new Web Service on Render.com
-
Connect your GitHub repository
-
Configure the service:
- Name: SchedulerPost Bot
- Environment: Node
- Build Command:
npm install - Start Command:
npm start - Plan: Free (or paid for better performance)
-
Add environment variables in the Render dashboard:
TELEGRAM_BOT_TOKENGEMINI_API_KEYHUGGINGFACE_API_KEYCHANNEL_ID(optional)
-
Deploy the service
Start the bot by sending /start in Telegram. The bot will display available commands:
- Add the bot as an administrator to your Telegram channel
- Use the
/set_channelcommand in your private chat with the bot - Send your channel username (e.g., @yourchannel) or channel ID when prompted
- The bot will verify access by sending a test message
/generate_post- Generate a complete post with text and image/schedule- Schedule a post/list_scheduled- List all scheduled posts/cancel_scheduled- Cancel a scheduled post
- Each user can configure their own channel for posting
- The bot must be an administrator in your channel to post content
- If no channel is configured, posts will be sent to the chat where the command was issued
- Daily post limit is set to 3 posts per day to prevent API overuse