Skip to content

Repository files navigation

TUS logo

TUSTelegram Username Sniper

Stars License Go 1.25 gotd/td fragment

TUS

🇷🇺 Молниеносный снайпер Telegram-юзернеймов на Go. Автоматически мониторит и забирает юзернеймы, как только они становятся доступны.

🇬🇧 Lightning-fast Telegram username sniper in Go. Automatically monitors and claims usernames the moment they become available.

Обновлённая версия / Updated version: Go 1.25 + github.com/gotd/td v0.161.0 (последний MTProto-слой Telegram / latest Telegram MTProto layer).


⚡ Быстрая установка / Quick install

🇷🇺 Русский

# Linux/macOS — скачает бинарь под твою платформу, проверит SHA256, настроит конфиг:
curl -fsSL https://raw.githubusercontent.com/ixode0/TUS/main/install.sh | bash
# с параметрами (без вопросов):
curl -fsSL https://raw.githubusercontent.com/ixode0/TUS/main/install.sh | bash -s -- \
  --api-id 12345 --api-hash abcdef... --phone +1234567890 --usernames user1,user2
tus   # запуск (первый раз попросит код из Telegram)

Windows (PowerShell):

irm https://raw.githubusercontent.com/ixode0/TUS/main/install.ps1 | iex

🇬🇧 English

curl -fsSL https://raw.githubusercontent.com/ixode0/TUS/main/install.sh | bash -s -- \
  --api-id 12345 --api-hash abcdef... --phone +1234567890 --usernames user1,user2
tus

Ручная установка из исходников / Manual build: см. Running.

🇷🇺 install.sh качает бинарь из GitHub Releases (ассеты sniper-linux/darwin-amd64/arm64, для Windows — sniper-windows-amd64.exe через install.ps1, плюс SHA256SUMS.txt; собирает .github/workflows/release.yml по тегу v*). После push проверь: Actions → CI зелёный → (для релиза: поставь тег vX.Y.Z) → Releases → скачай бинарь. 🇬🇧 install.sh fetches the binary from GitHub Releases (assets sniper-linux/darwin-amd64/arm64, for Windows — sniper-windows-amd64.exe via install.ps1, plus SHA256SUMS.txt; built by .github/workflows/release.yml on tag v*). After pushing, verify: Actions → CI green → (for a release: tag vX.Y.Z) → Releases → download the binary.


🤖 Промт для ИИ / AI Prompt

🇷🇺 Русский

Забудьте про ручную правку config.json. Если вы пользуетесь ИИ-помощником — скопируйте этот промт, и он настроит всё сам:

Вот репозиторий снайпера Telegram-юзернеймов: TUS (Go) — https://github.com/ixode0/TUS.git

1. Проще всего — установщик выше (`install.sh` ставит готовый бинарь). Вручную: git clone https://github.com/ixode0/TUS.git && cd TUS, затем выполни go mod tidy и собери: go build -o sniper ./cmd/app (Go 1.25+, модуль github.com/ixode0/TUS).
2. Запроси у пользователя по очереди:
   - API ID и API Hash (он их получит на https://my.telegram.org → API development tools)
   - номер телефона в международном формате (+..., с плюсом — валидация строгая)
   - список юзернеймов для мониторинга (массив usernames, без @)
   - способ клейма: channel (создать публичный канал с title = username и затем установить юзернейм) или user (account.updateUsername на аккаунт)
   - паузу между проверками в мс (sleep_between_check, рекомендуется 100, <50 — уже риск FloodWait)
3. Заполни config.json этими данными (лежит в корне репо; можно переопределить путь через env CONFIG_PATH).
4. Запусти ./sniper рядом с config.json.
5. При первом запуске программа запросит код авторизации — попроси его у пользователя и передай программе через stdin. Для автоматики: можно заранее задать env TG_CODE или положить код в файл /tmp/tg_code.txt (файл удалится после чтения). Если у аккаунта включена 2FA — следующим шагом запросит пароль (Enter your password:).
6. Сессия сохранится в session_DO_NOT_SHARE.json рядом с бинарём (FileStorage) — добавь его в .gitignore и никому не показывай.
7. Если снайпер не смог забрать юзернейм сразу — он будет ретраить каждые 1.5с бесконечно (отдельная горутина на каждый юзернейм), с корректной обработкой FloodWait (ждёт указанное время) и остановкой при USERNAME_OCCUPIED / USERNAME_NOT_AVAILABLE. Отчитайся пользователю, когда юзернейм будет успешно захвачен (лог [Successfully claimed: ...]).

Этот промт особенно удобен, если у пользователя нет окружения Go — ИИ сделает сборку и запуск за него.

🇬🇧 English

Forget manual config.json editing. If you use an AI assistant — copy this prompt and it will set everything up:

Here's the Telegram username sniper repository: TUS (Go) — https://github.com/ixode0/TUS.git

1. Easiest — the installer above (`install.sh` fetches a ready binary). Manually: git clone https://github.com/ixode0/TUS.git && cd TUS, then run go mod tidy and build: go build -o sniper ./cmd/app (Go 1.25+, module github.com/ixode0/TUS).
2. Ask the user step-by-step for:
   - API ID and API Hash (from https://my.telegram.org → API development tools)
   - phone number in international format (+..., with plus — strict validation)
   - list of usernames to monitor (usernames array, without @)
   - claim method: channel (create public channel with title = username then set username) or user (account.updateUsername on the account)
   - delay between checks in ms (sleep_between_check, recommended 100, <50 risks FloodWait)
3. Fill config.json with this data (located at repo root; path can be overridden via env CONFIG_PATH).
4. Run ./sniper next to config.json.
5. On first launch the app will request an auth code — ask the user for it and pass it via stdin. For automation: pre-set env TG_CODE or put the code into /tmp/tg_code.txt (file is deleted after reading). If the account has 2FA enabled — next it will ask for password (Enter your password:).
6. Session will be saved to session_DO_NOT_SHARE.json next to the binary (FileStorage) — add it to .gitignore and never share it.
7. If the sniper fails to claim immediately — it will retry every 1.5s forever (separate goroutine per username), with proper FloodWait handling (waits the required duration) and stopping on USERNAME_OCCUPIED / USERNAME_NOT_AVAILABLE. Notify the user when the username is successfully claimed (log [Successfully claimed: ...]).

This prompt is especially handy if the user has no Go environment — the AI will handle build and run.


⚙️ Как это работает / How It Works

🇷🇺 Русский

  1. Сервис проверяет доступность юзернейма через fragment.com.
  2. Как только юзернейм становится Available, снайпер через Telegram API либо создаёт новый канал, либо назначает юзернейм на аккаунт — зависит от настроек.
  3. При неудаче повторяет попытку каждые 1.5 секунды до успеха (с учётом FloodWait).

🇬🇧 English

  1. The service checks username availability via fragment.com.
  2. As soon as the username becomes Available, the sniper via Telegram API either creates a new channel or assigns the username to the account — depending on settings.
  3. On failure it retries every 1.5 seconds until success (respecting FloodWait).

✨ Возможности / Features

🇷🇺 Русский

  • Гибкий способ клейма: channel (канал) или user (аккаунт)
  • Несколько юзернеймов в списке
  • Авто-удаление уже занятых юзернеймов из мониторинга
  • Бесконечный ретрай каждые 1.5с + учёт FloodWait
  • Интерактивная авторизация Telegram
  • Постоянная сессия (session_DO_NOT_SHARE.json)
  • Публичный канал создаётся автоматически с title = username
  • Прокси
  • Несколько аккаунтов

🇬🇧 English

  • Flexible claim method: channel or user
  • Multiple usernames in watchlist
  • Auto-removal of already taken usernames from monitoring
  • Infinite retry every 1.5s + FloodWait handling
  • Interactive Telegram authorization
  • Persistent session (session_DO_NOT_SHARE.json)
  • Public channel is created automatically with title = username
  • Proxy
  • Multiple accounts

❓ FAQ / Частые вопросы

🇷🇺 Русский

Q: Можно ли снайпить юзернеймы на аукционе fragment? A: Нет. Юзернеймы на аукционе автосвопятся и никогда не становятся доступны для клейма.

Q: Можно ли использовать bot token? A: Нет. Боты не имеют доступа к channels.createChannel и account.updateUsername, которые требуются снайперу. Нужен обычный аккаунт (user).

Q: Почему лучше клеймить в канал? A: У каналов меньше рейт-лимитов, а юзернейм канала всё равно можно продать на fragment. Настраивается через claim_to.

Q: Сколько юзернеймов мониторить? A: Не рекомендуется больше 5 за раз — при большом количестве есть шанс пропустить момент освобождения. Лучше меньше юзов + терпение.

Q: Как находить юзернеймы под снайпинг? A:

  1. Онлайн-площадки продажи Telegram-юзернеймов.
  2. Неактивные аккаунты («last seen a long time ago») — такие могут быть удалены в ближайшие 1-12 месяцев.

🇬🇧 English

Q: Can I snipe usernames that are on fragment auction? A: No. Auction usernames are auto-swapped and never become available to claim.

Q: Can I use a bot token? A: No. Bots don't have access to channels.createChannel and account.updateUsername required by the sniper. You need a regular user account.

Q: Why is claiming to a channel better? A: Channels have fewer rate limits, and a channel username can still be sold on fragment. Configured via claim_to.

Q: How many usernames should I monitor? A: Not recommended more than 5 at once — with many usernames you may miss the release moment. Fewer targets + patience is better.

Q: How to find usernames to snipe? A:

  1. Online Telegram username marketplaces.
  2. Inactive accounts ("last seen a long time ago") — such accounts may be deleted in the next 1-12 months.

Q: Пустой ответ fragment — это Available? / Is an empty fragment response Available? A: 🇷🇺 Нет — пустой h = Unknown (не Available), клейм не запускается, мониторинг продолжает ждать. 🇬🇧 No — empty h = Unknown, no claim is started.

Q: Как использовать прокси? / How to use a proxy? A: 🇷🇺 Отдельного поля нет — fragment идёт через env: export HTTPS_PROXY=http://127.0.0.1:8080 или export HTTPS_PROXY=socks5://127.0.0.1:1080 (поддержаны HTTP_PROXY/HTTPS_PROXY, в т.ч. socks5://). 🇬🇧 No dedicated field — set HTTPS_PROXY/HTTP_PROXY env (incl. socks5://), e.g. HTTPS_PROXY=socks5://127.0.0.1:1080 ./sniper.

Q: Сколько потоков проверки? / How many check threads? A: 🇷🇺 Монитор проверяет до 5 юзернеймов параллельно, пауза одна на раунд (sleep_between_check). 🇬🇧 Monitor checks up to 5 usernames in parallel, one sleep per round.

Q: Где канонический путь репозитория? / What is the canonical path? A: 🇷🇺 Каноника — https://github.com/ixode0/TUS. 🇬🇧 Canonical — https://github.com/ixode0/TUS.


🔧 Конфигурация / Configuration

🇷🇺 Русский

Скопируйте config.example.json в config.json и заполните (config.json в .gitignore — секреты никогда не коммитятся):

{
    "telegram": {
        "phone_number": "+1234567890",
        "api_id": 12345,
        "api_hash": "abcdef1234567890"
    },
    "claim_to": "channel",
    "sleep_between_check": 100,
    "usernames": [
        "your_username"
    ]
}
Поле Описание
telegram.phone_number Номер аккаунта в международном формате (+1234567890)
telegram.api_id / telegram.api_hash Получить на https://my.telegram.orgAPI development tools
claim_to Способ клейма: channel или user (регистр не важен, Channelchannel). user — деструктивно: заменяет юзернейм аккаунта, перед клеймом спросит YES
sleep_between_check Пауза между проверками, мс. Дефолт 100 (пусто/0 → 100). Менее 50 может вызвать рейт-лимиты (FloodWait)
usernames Список юзернеймов для мониторинга без @ (например ["dead", "devious"]; @dead тоже примут — @ срежется, регистр → нижний)
CLAIM_MAX_ATTEMPTS (env) Лимит попыток клейма на юзернейм. Дефолт 0 = бесконечно (остановка только по успеху/постоянной ошибке/выходу). Пример: CLAIM_MAX_ATTEMPTS=200 ./sniper

🇬🇧 English

Copy config.example.json to config.json and fill it (config.json is git-ignored — secrets are never committed):

{
    "telegram": {
        "phone_number": "+1234567890",
        "api_id": 12345,
        "api_hash": "abcdef1234567890"
    },
    "claim_to": "channel",
    "sleep_between_check": 100,
    "usernames": [
        "your_username"
    ]
}
Field Description
telegram.phone_number Account phone in international format (+1234567890; spaces/dashes are stripped, leading 8 → use +7 instead)
telegram.api_id / telegram.api_hash Get at https://my.telegram.orgAPI development tools
claim_to Claim method: channel or user (case-insensitive). user is destructive: replaces the account username, asks for YES first
sleep_between_check Delay between checks, ms. Default 100 (missing/0 → 100). Below 50 may trigger rate limits
usernames List of usernames to watch without @ (e.g. ["dead", "devious"]; leading @ is stripped, lowercased)
CLAIM_MAX_ATTEMPTS (env) Max claim attempts per username. Default 0 = unlimited (stops only on success/permanent error/shutdown). E.g. CLAIM_MAX_ATTEMPTS=200 ./sniper

🚀 Запуск / Running

🇷🇺 Русский

# Требуется Go 1.25+
cp config.example.json config.json  # затем заполните api_id/api_hash/phone/usernames
go mod tidy

go run ./cmd/app  # из корня репо

Или собрать бинарь и запустить рядом с config.json:

go build -o sniper ./cmd/app
./sniper

При первом запуске будет запрошен код авторизации из Telegram — он придёт в чат приложения (не СМС, ввод скрыт: вставь и Enter). Если включена 2FA — далее запросит пароль 2FA (ввод тоже скрыт). После этого сессия сохранится в session_DO_NOT_SHARE.json (не делитесь и не коммитьте этот файл).

Не-интерактивный запуск: код можно подложить в TG_CODE (env) или файл /tmp/tg_code.txt (удалится после чтения). Пароль 2FA при необходимости — через stdin (скрытый ввод).

🇬🇧 English

# Requires Go 1.25+
cp config.example.json config.json  # then fill api_id/api_hash/phone/usernames
go mod tidy

go run ./cmd/app  # from repo root

Or build the binary and run next to config.json:

go build -o sniper ./cmd/app
./sniper

On first launch you'll be asked for the Telegram auth code — it arrives in the app chat (not SMS, hidden input: paste + Enter). If 2FA is enabled — it will then ask for the 2FA password (also hidden). Afterwards the session is saved to session_DO_NOT_SHARE.json (do not share or commit this file).

Non-interactive run: you can provide the code via TG_CODE env or /tmp/tg_code.txt file (deleted after reading). 2FA password if needed — via stdin (hidden input).


📜 Происхождение / Credits

🇷🇺 Русский

Частично походит из оригинального проекта: qg5/telegram-username-sniper (MIT).

🇬🇧 English

Partially based on the original project: qg5/telegram-username-sniper (MIT).

Лицензия / License: MIT

About

TUS — Lightning-fast Telegram Username Sniper (Go 1.25 + gotd/td) | Auto-claim usernames via MTProto the moment they become available | fragment.com monitor + channel/user claim + FloodWait + AI setup prompt

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages