{"id":31910637,"url":"https://github.com/altudev/1453-ai-telegram-bot","last_synced_at":"2025-10-13T16:53:25.586Z","repository":{"id":315286665,"uuid":"1058883594","full_name":"altudev/1453-ai-telegram-bot","owner":"altudev","description":"1453-ai icin telegram haber verici bot","archived":false,"fork":false,"pushed_at":"2025-09-17T18:53:09.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-17T19:51:51.962Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/altudev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-17T17:18:38.000Z","updated_at":"2025-09-17T18:53:14.000Z","dependencies_parsed_at":"2025-09-17T20:03:06.503Z","dependency_job_id":null,"html_url":"https://github.com/altudev/1453-ai-telegram-bot","commit_stats":null,"previous_names":["altudev/1453-ai-telegram-bot"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/altudev/1453-ai-telegram-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altudev%2F1453-ai-telegram-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altudev%2F1453-ai-telegram-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altudev%2F1453-ai-telegram-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altudev%2F1453-ai-telegram-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/altudev","download_url":"https://codeload.github.com/altudev/1453-ai-telegram-bot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altudev%2F1453-ai-telegram-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016117,"owners_count":26085804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-13T16:53:20.479Z","updated_at":"2025-10-13T16:53:25.581Z","avatar_url":"https://github.com/altudev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 1453-ai-telegram-bot\n\nYouTube Livestream Telegram Notification Bot that monitors YouTube's PubSub notifications for video description updates, detects the \"#live\" tag, and sends notifications to Telegram channels.\n\n## Features\n\n- Monitors YouTube channel for new videos via WebSub (PubSubHubbub)\n- Detects \"#live\" tag in video descriptions\n- Sends formatted notifications to Telegram channels\n- Turkish language support for notifications\n- Deduplication to prevent repeated notifications\n- Error handling and retry mechanisms\n- Health check endpoint\n- Docker support for easy deployment\n\n## Prerequisites\n\n- Node.js 18+ or Bun 1.2.22+\n- Redis server (for deduplication)\n- YouTube Data API key\n- Telegram bot token\n- YouTube channel ID\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/yourusername/1453-ai-telegram-bot.git\ncd 1453-ai-telegram-bot\n```\n\n2. Install dependencies:\n```bash\nbun install\n```\n\n3. Set up environment variables:\n```bash\ncp .env.example .env\n```\n\n4. Edit the `.env` file with your configuration:\n```env\n# YouTube Configuration\nYOUTUBE_CHANNEL_ID=UCyour_channel_id_here\nYOUTUBE_API_KEY=your_youtube_api_key_here\n\n# Telegram Configuration\nTELEGRAM_BOT_TOKEN=your_telegram_bot_token_here\nTELEGRAM_CHAT_CONFIGS=[{\"chatId\":\"chat_id_1\",\"topicId\":1},{\"chatId\":\"chat_id_2\",\"topicId\":2},{\"chatId\":\"chat_id_3\"}]\n\n# Platform Links (JSON format)\nPLATFORM_LINKS={\"youtube\":\"https://youtube.com/@yourchannel\",\"x\":\"https://x.com/yourusername\",\"kick\":\"https://kick.com/yourusername\",\"twitch\":\"https://twitch.tv/yourusername\",\"instagram\":\"https://instagram.com/yourusername\",\"linkedin\":\"https://linkedin.com/in/yourusername\"}\n\n# Server Configuration\nPORT=3000\nWEBHOOK_SECRET=your_webhook_secret_here\nBASE_URL=https://yourdomain.com\n\n# Logging Configuration\nLOG_LEVEL=info\n\n# Redis Configuration (for deduplication)\nREDIS_URL=redis://localhost:6379\n```\n\n## Running the Application\n\n### Development\n\n```bash\nbun run dev\n```\n\n### Production\n\n```bash\nbun run start\n```\n\n## Docker Deployment\n\n### Building the Docker Image\n\n```bash\ndocker build -t 1453-ai-telegram-bot .\n```\n\n### Running with Docker\n\n```bash\ndocker run -d \\\n  --name 1453-ai-telegram-bot \\\n  -p 3000:3000 \\\n  -e YOUTUBE_CHANNEL_ID=your_channel_id \\\n  -e YOUTUBE_API_KEY=your_api_key \\\n  -e TELEGRAM_BOT_TOKEN=your_bot_token \\\n  -e TELEGRAM_CHAT_CONFIGS='[{\"chatId\":\"chat_id_1\",\"topicId\":1},{\"chatId\":\"chat_id_2\",\"topicId\":2}]' \\\n  -e PLATFORM_LINKS='{\"youtube\":\"https://youtube.com/@yourchannel\",\"x\":\"https://x.com/yourusername\",\"kick\":\"https://kick.com/yourusername\",\"twitch\":\"https://twitch.tv/yourusername\",\"instagram\":\"https://instagram.com/yourusername\",\"linkedin\":\"https://linkedin.com/in/yourusername\"}' \\\n  -e WEBHOOK_SECRET=your_webhook_secret \\\n  -e BASE_URL=https://yourdomain.com \\\n  -e REDIS_URL=redis://redis:6379 \\\n  1453-ai-telegram-bot\n```\n\n### Coolify Deployment\n\n1. Create a new application in Coolify\n2. Connect your Git repository\n3. Use the provided `coolify.yaml` configuration\n4. Set up the required environment variables in Coolify\n5. Deploy the application\n\n## API Endpoints\n\n- `GET /health` - Health check endpoint\n- `GET /websub` - WebSub subscription verification\n- `POST /websub` - WebSub callback endpoint\n\n## Configuration\n\n### Environment Variables\n\n| Variable | Description | Required |\n|----------|-------------|----------|\n| `YOUTUBE_CHANNEL_ID` | The YouTube channel ID to monitor | Yes |\n| `YOUTUBE_API_KEY` | YouTube Data API key | Yes |\n| `TELEGRAM_BOT_TOKEN` | Telegram bot token | Yes |\n| `TELEGRAM_CHAT_CONFIGS` | JSON array of chat configurations with optional topic IDs | Yes |\n| `PLATFORM_LINKS` | JSON string with platform links | Yes |\n| `PORT` | Port for the HTTP server | No (default: 3000) |\n| `WEBHOOK_SECRET` | Secret for verifying WebSub callbacks | Yes |\n| `BASE_URL` | Base URL for WebSub callbacks | Yes |\n| `LOG_LEVEL` | Logging level (error, warn, info, debug) | No (default: info) |\n| `REDIS_URL` | Redis connection URL | Yes |\n\n### Platform Links Format\n\nThe `PLATFORM_LINKS` environment variable should be a JSON string with the following structure:\n\n```json\n{\n  \"youtube\": \"https://youtube.com/@yourchannel\",\n  \"x\": \"https://x.com/yourusername\",\n  \"kick\": \"https://kick.com/yourusername\",\n  \"twitch\": \"https://twitch.tv/yourusername\",\n  \"instagram\": \"https://instagram.com/yourusername\",\n  \"linkedin\": \"https://linkedin.com/in/yourusername\"\n}\n```\n\n### Telegram Chat Configs Format\n\nThe `TELEGRAM_CHAT_CONFIGS` environment variable should be a JSON array of chat configurations. Each configuration can optionally include a topic ID for sending messages to specific topics within a group:\n\n```json\n[\n  {\n    \"chatId\": \"-1001234567890\",\n    \"topicId\": 1\n  },\n  {\n    \"chatId\": \"-1000987654321\"\n  }\n]\n```\n\n- `chatId`: The Telegram chat ID (required)\n- `topicId`: The topic ID within the chat (optional). If not provided, messages will be sent to the main chat.\n\nTo get chat and topic IDs:\n1. For regular channels/groups: Send a message to the chat and use `/getupdates` API or a bot like @JsonDumpBot to get the chat ID\n2. For topics in supergroups: Send a message to the topic and use a bot to get the message ID, which corresponds to the topic ID\n\n## Monitoring and Logging\n\n- Logs are written to both console and files (`logs/error.log` and `logs/combined.log`)\n- Health check endpoint available at `/health`\n- Structured logging with Winston\n\n## Troubleshooting\n\n### Common Issues\n\n1. **WebSub subscription fails**\n   - Ensure the `BASE_URL` is correctly set and accessible from the internet\n   - Check that the webhook secret matches between your application and YouTube\n\n2. **Telegram notifications not sending**\n   - Verify the bot token is correct\n   - Ensure the bot has permission to send messages to the specified chat IDs and topics\n   - Check the `TELEGRAM_CHAT_CONFIGS` JSON format is valid\n   - Verify the bot is added to the chat and has appropriate permissions\n   - Check the logs for error messages\n\n3. **Redis connection errors**\n   - Verify Redis is running and accessible\n   - Check the `REDIS_URL` environment variable\n\n4. **YouTube API errors**\n   - Verify the API key is correct and has the necessary permissions\n   - Check if you've exceeded the API quota\n\n### Manual Override\n\nTo manually trigger a notification, you can use the `/notify` command in Telegram (if implemented).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## Support\n\nFor support, please open an issue in the GitHub repository or contact the maintainers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltudev%2F1453-ai-telegram-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faltudev%2F1453-ai-telegram-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltudev%2F1453-ai-telegram-bot/lists"}