❤️‍🔥🤖
Find a file
2024-09-09 11:42:37 -04:00
app fixed temp file record for media file paths 2024-09-09 11:42:37 -04:00
docker-compose.yml init 2024-08-21 22:24:20 -04:00
README.md init 2024-08-21 22:24:20 -04:00

affection-x-bot

Creates posts on X from messages on Telegram. Supports images and video but limited to 512mb and 140 seconds.

Getting Started

  • Clone the repo
  • Open the app folder
  • Rename sample.env to .env
  • Set your Telegram Admin ID. This is an integer value representing your main account.
  • Enter your Telegram bot token from @botfather
  • Enter your Telegram App ID and App Hash from my.telegram.org
  • Enter your X username and access/consumer/client credentials from the Developer Portal

Bare Metal

  • Type pip install -r requirements.txt to install dependencies
  • Follow the instructions below to authenticate with X
  • Run by typing python main.py

Docker

  • Run by typing docker compose up -d in the repo's root folder
  • Enter the docker container by typing docker exec -it affection-x-bot bash
  • Follow the instructions below to authenticate with X
  • Press CTRL+D to exit the container

X

You will need both v1 and v2 API credentials from the Developer Portal

  • Run python login-to-x.py to authorize your X account with the bot
  • Copy the the URL and authorize your X account using a browser
  • It will redirect you to a localhost URL. Copy/paste that URL back into the auth script and press enter. It will save your X credentials to the data folder

Telegram

This bot only works for supergroups (public). You will need a bot token from @botfather + a custom app created using my.telegram.org

  • Add the bot to your supergroup as admin