Project

TelegramToX Bot

Telegram → X (Twitter) Bridge

Overview

A Python bot that listens to a specific Telegram channel and automatically reposts messages (text, photos, or videos) to an X (Twitter) account using OAuth 1.0a. Manages rate limits, handles media uploads, and keeps a daily usage counter to avoid hitting Twitter's limits.

Key Features

  • Full Media Support: Reposts text, photos, videos, and other media from Telegram to Twitter.
  • Rate Limit Management: Tracks daily API usage to avoid hitting Twitter's rate limits.
  • OAuth Authentication: Uses Twitter API v2 with OAuth 1.0a for secure posting.
  • Error Handling: Gracefully handles common errors like rate limits, forbidden access, and missing media.
  • Local Storage: Keeps a JSON counter file to track daily request usage.

Technologies

Python python-telegram-bot tweepy OAuth 1.0a python-dotenv

Links

This bot requires OAuth credentials for Twitter and a Telegram bot token, so there is no public instance available.