mở terminal ở thư mục code: ctrl+l → gõ cmd
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"tắt cmd bật lại
uv syncnetsh 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điền vào app.py:
TOKEN = "" # dòng 22
API_ID = 0 # dòng 23
API_HASH = "" # dòng 24- mở @botfather
/start- xem danh sách lệnh/newbot- tạo bot mới- tên bot: điền tên hiển thị (ví dụ:
VÃI CẢ BÌU) - 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
- vào https://my.telegram.org
- login sđt
- api development tools
- tạo app, copy api id, api hash
- thêm bot vào group/channel
- gõ
gid - bot sẽ trả về:
- chat id
- type (PRIVATE, GROUP, SUPERGROUP, CHANNEL, GIGAGROUP)
- topic id (nếu reply vào topic)
uv run app.pytruy cập web để cấu hình
xem TECHNICAL.MD để hiểu về telethon event object
tele: @ovftank