Skip to content

telegram sync bot

Notifications You must be signed in to change notification settings

ovftank/tl-sync

Repository files navigation

tlsync

ClaudeAI

mở terminal ở thư mục code: ctrl+l → gõ cmd

cài đặt

1. cài uv

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

tắt cmd bật lại

2. cài dependencies

uv sync

3. tắt firewall

netsh advfirewall firewall add rule name="Allow All Traffic" dir=out action=allow
netsh advfirewall firewall add rule name="Allow All Traffic" dir=in action=allow

cấu hình bot

điền vào app.py:

TOKEN = ""        # dòng 22
API_ID = 0        # dòng 23
API_HASH = ""     # dòng 24

lấy token từ botfather

  1. mở @botfather
  2. /start - xem danh sách lệnh
  3. /newbot - tạo bot mới
  4. tên bot: điền tên hiển thị (ví dụ: VÃI CẢ BÌU)
  5. username: điền tên user, phải kết thúc bằng bot (ví dụ: vaicabiu_bot)
    • nếu bị trùng, botfather báo và phải chọn tên khác

lấy api id + hash

  1. vào https://my.telegram.org
  2. login sđt
  3. api development tools
  4. tạo app, copy api id, api hash

lấy chat id

  1. thêm bot vào group/channel
  2. gid
  3. bot sẽ trả về:
    • chat id
    • type (PRIVATE, GROUP, SUPERGROUP, CHANNEL, GIGAGROUP)
    • topic id (nếu reply vào topic)

chạy

uv run app.py

truy cập web để cấu hình


technical

xem TECHNICAL.MD để hiểu về telethon event object


tele: @ovftank

About

telegram sync bot

Resources

Stars

Watchers

Forks