π€ ARC-LINK: AIO File Utility Bot β Zip ποΈ / Unzip π¦ / Merge π§© / FTL π (Buttons-First)
An all-in-one Telegram bot that auto-detects what users send (archives vs normal files) and responds using a single Session Panel (buttons-first, minimal chat spam).
β
ποΈ Zip (auto-split for Telegram limits)
β
π¦ Unzip (single / multi-part / multiple archives)
β
π§© Merge (extract β combine β re-zip)
β
π Password support (extract protected archives + add/remove password on output)
β
π FTL (File-To-Link: direct download + stream links)
β
π Authorization + DM-only access control
β
π Stats (queue count, usage, disk space)
β
π οΈ Admin Panel (live stats + auth/logs management)
β
π§Ύ Logs Channel (file/job lifecycle logs)
This bot is designed to work only in private chat (DM).
A user is allowed if either:
- π₯ They are a member of the Main Group (
MAIN_GROUP_IDin.env)
(the bot checks membership viagetChatMemberβ the bot must be in that group)
OR - β They are added to the botβs Authorization List (managed by admins)
- Any chat that is not DM (groups/channels): bot replies with a short βDM meβ notice
- Any user who is not in Main Group and not in Authorization List
Admins (from ADMIN_IDS) can manage everything via π οΈ Admin Panel:
- Add/Remove users from Authorization List
- Change Main Group ID (runtime)
- Configure Logs Channel (runtime)
Instead of spamming messages, the bot:
- creates one panel message
- edits it as files arrive
- finalizes when either:
- user taps β Done sending, OR
- an inactivity window (e.g. 2β3s) expires
- then shows the correct buttons based on what was detected
π§Ύ Session Panel Detailed Examples (click to expand)
Below are mock panels showing how the botβs single edited Session Panel message can look in each scenario.
Buttons are represented as[π Button].
π§Ύ Session Panel
π₯ Receiving filesβ¦
π¦ Archives: 0 π Files: 3
π Total size: 842 MB
ⳠWaiting for more⦠(auto-finish in 2s)
Buttons:
[β
Done sending] [π§Ύ List] [β Cancel]
π§Ύ Session Panel
π¦ Archive detected: pack.zip
π Size: 1.6 GB | π Password: Unknown
What do you want to do?
Buttons:
[π Unzip] [π§Ύ List contents] [π― Extract selected]
[π Password] [βοΈ Settings] [β Cancel]
π§Ύ Session Panel
π Protected archive detected: protected.zip
β Password required to extract.
Send the password now (as a message), or cancel.
Buttons:
[π Enter password] [β Cancel]
β After user sends password:
π§Ύ Session Panel
π Password received (session only)
π¦ Extractingβ¦ 37%
Buttons:
[β Cancel]
π§Ύ Session Panel
β
Extracted successfully: protected.zip
π Password used: Yes (session)
What next?
Buttons:
[β
Send extracted files]
[π Remove password & send] [π Add password & send]
[β Cancel]
π§Ύ Session Panel
π¦ 4 archives detected
π Total size: 5.8 GB
π§ Detected pattern: π§© Parts of one archive (High confidence)
Choose how to proceed:
Buttons:
[π§© Parts Mode Unzip] [π¦ Separate Unzip]
[π§© Merge β Rezip] [π§Ύ List] [β Cancel]
β All parts present:
π§Ύ Session Panel
π§© Parts Mode selected
π Checking partsβ¦
β
Found: 12/12 parts
Proceed to extract?
Buttons:
[π Unzip now] [π§Ύ List contents] [β Cancel]
π§Ύ Session Panel
π§© Parts Mode selected
π Checking partsβ¦
β οΈ Missing parts detected
Found: 10/12 parts
Continue anyway (may fail) or cancel?
Buttons:
[
π§Ύ Session Panel
π 7 files detected (non-archive)
π Total size: 1.2 GB
Choose a mode:
Buttons:
[π Get Links (FTL)] [π Make Archive]
[π§Ύ List] [β Cancel]
π§Ύ Session Panel
π FTL mode selected
π Files: 7
Choose link type:
Buttons:
[π¬ Stream links] [β¬οΈ Direct links] [π Copy all] [β Cancel]
After generating (paged):
π§Ύ Session Panel
β
Links ready (Page 1/2)
1) file1.mp4 π¬ Stream | β¬οΈ Direct
2) file2.mp4 π¬ Stream | β¬οΈ Direct
3) file3.mp4 π¬ Stream | β¬οΈ Direct
Buttons:
[β Next page] [π Copy all] [β Cancel]
π§Ύ Session Panel
π Zip mode selected
π Files: 12
π Total size: 6.4 GB
Choose archive format:
Buttons:
[π ZIP] [π§ 7Z] [β¬
οΈ Back] [β Cancel]
Next:
π§Ύ Session Panel
π¦ Choose part size (Telegram-safe):
Buttons:
[1900MiB β
Recommended] [1024MiB] [Custom βοΈ] [β¬
οΈ Back] [β Cancel]
Optional password:
π§Ύ Session Panel
π Add password to output archive?
(If you skip, archive will be unprotected.)
Buttons:
[π Add password] [π Skip] [β¬
οΈ Back] [β Cancel]
After starting:
π§Ύ Session Panel
π Creating archiveβ¦ 41%
π¦ Output will be split into parts if needed.
Buttons:
[β Cancel]
The bot classifies the current batch into:
- π¦ Archives only
- π Non-archives only
- π§© Mixed (archives + non-archives)
If multiple archives exist, it also tries to detect:
- π§© Parts Mode (split archive parts like
.001,.part1.rar,.z01, etc.) - π¦ Separate Archives (independent archives)
If detection is unsure, user can override via buttons:
- Treat as Parts
- Treat as Separate
- Mixed options
- β Collect many files into one archive
- β Auto-split output into multiple parts (Telegram-safe)
- β Choose output: ZIP / 7Z (optional)
- β Choose part size: 1900MiB / 1024MiB / Custom
- β
Rename output via buttons or
/zipname - β Optional: π Add password to output archive
- β Cleanup after completion
- β Unzip a single archive
- β Unzip multi-part / split archives (Parts Mode)
- β Unzip many independent archives (Separate Mode)
- β List contents before extract π§Ύ
- β Extract selected files π―
- β Protected archive detection
- β If protected, bot prompts: π βSend passwordβ
- β Password remembered per session only
- β
After extraction, user can optionally:
- π Remove password & send (rezip unencrypted)
- π Add password & send (rezip encrypted)
For multiple archives in a batch:
- β extract all β combine β re-zip into one archive
- β choose output format + part size
- β optional password on final output
- β Generate direct download + stream links for sent files
- β Paging for many files (avoids FloodWait spam)
- β π Copy all links
- β DM-only usage (no group usage)
- β Allow access if user is in Main Group OR in Authorization List
- β Admin-managed Authorization List (add/remove)
- β Admin can change Main Group ID at runtime
- β Shows queue count (how many jobs waiting/running β not full job details)
- β Shows usage totals (jobs processed, unique users, uptime)
- β Shows free disk space (+ optional memory/CPU)
- β Admin version includes βwho is currently using the botβ
- β Live stats: connected users, active sessions, queue counts
- β Manage Authorization List (add/remove users)
- β Change Main Group ID (runtime)
- β Configure Logs Channel (runtime)
- β Enable/Disable logs + choose what to log
- β Sends file/job lifecycle logs to a logs channel
- β
Configurable via
.envand changeable via Admin Panel - β Useful for moderation, debugging, and auditing usage
Most users can operate fully via buttons. Commands are mainly entry points.
/startβ show help + current session panel/helpβ quick usage/commandsβ list all commands/cancelβ cancel current job/session/statsβ show bot stats (queue count, usage, free disk)
/addβ start collecting files for zipping/zip <name>β create archive now (optional if using buttons)/zipname <name>β set default archive name for session/zipclearβ clear collected files
/unzipβ show unzip actions for current batch (optional)/ftlβ show link generation actions (optional)
/adminβ open Admin Panel/logsβ quick toggle or logs preview (optional; can also live inside Admin Panel)
/addthumbβ set thumbnail (reply to a photo)/delthumbβ remove thumbnail/modeβ upload mode (Document / Video etc.)
User /stats
π ARC-LINK Stats
π§Ύ Queue: 3 (waiting: 2, running: 1)
π₯ Unique users: 148
β
Jobs processed: 1,920
β± Uptime: 2d 04h
πΎ Disk free: 37.4 GB
Admin /admin β Stats
π Admin Stats
π§Ύ Queue: 3 (waiting: 2, running: 1)
π’ Active sessions: 2
π₯ Connected users: 148
π€ Currently using bot:
- @user1 (unzipping)
- @user2 (zipping)
π οΈ Admin Panel β ARC-LINK
π Queue: 3 (2 waiting / 1 running)
π’ Active sessions: 2
π₯ Connected users: 148
πΎ Disk free: 37.4 GB
π§Ύ Logs: β
Enabled | Channel: -1001234567890
π₯ Main Group: -1009876543210
Buttons:
[π Stats] [π₯ Authorization] [π₯ Main Group]
[π§Ύ Logs] [π£ Set Logs Channel] [βοΈ Settings]
[β Close]
π₯ Authorization
β
Allowed via Main Group: -1009876543210
β
Additional allowed users: 23
Send a user ID / @username to add/remove.
Buttons:
[β Add user] [β Remove user] [π§Ύ View list] [β¬
οΈ Back]
π§Ύ Logs
Status: β
Enabled
Channel: -1001234567890
Choose what to log:
Buttons:
[β
File added] [β
Job started] [β
Job finished] [
[π£ Set channel] [π Disable logs] [β¬
οΈ Back]
When enabled, the bot sends logs like:
π§Ύ LOG β’ Job Completed β
π€ User: @username (123456789)
π§© Mode: Merge β Rezip
π¦ Inputs: 3 archives (5.8 GB)
π Output: merged.part001.zip β¦ merged.part003.zip
β± Time: 03m 42s
π 2025-12-17 13:02:11
Suggested events to log:
- π₯ File added (name/size/type)
βΆοΈ Job started (mode/settings)- β Job completed (outputs/parts)
- β Job failed (error summary)
- π Links generated (count)
Note: All workflows require DM + Authorization.
Bot shows:
- π Unzip
- π§Ύ List contents
- π― Extract selected
- π Password (add/remove / prompt)
- βοΈ Settings
- β Cancel
Bot asks:
- π§© Parts Mode Unzip (treat as one split archive)
- π¦ Separate Unzip (each archive independently)
- π§© Merge β Rezip
- π§Ύ List
- β Cancel
Bot asks:
- π Get Links (FTL)
- ποΈ Make Archive
- π§Ύ Show list
- β Cancel
Bot asks:
- π¦ Archive actions
- π Links for non-archives
- ποΈ Zip everything together
- π§Ύ Show list
- β Cancel
flowchart TD
A["π€ User sends message"] --> B{"π¬ DM chat?"}
B -->|"No π«"| B1["π« Reply: Please DM me to use ARC-LINK"]
B -->|"Yes β
"| C{"π Authorized?"}
C -->|"No π«"| C1["π« Access denied<br/>Join Main Group or request access"]
C -->|"Yes β
"| D["π§Ύ Session Panel created/updated"]
D --> E{"β³ Inactivity window<br/>or β
Done sending?"}
E -->|"β
Done / Timer ends"| F["π Analyze batch"]
F --> G{"π¦ Archives only?"}
F --> H{"π Non-archives only?"}
F --> I{"π§© Mixed batch?"}
%% Archives only
G --> J{"π¦ How many archives?"}
J -->|"1οΈβ£ One"| K["π¦ Single Archive Menu<br/>π Unzip Β· π§Ύ List Β· π― Extract selected<br/>π Password Β· βοΈ Settings Β· β Cancel"]
J -->|"2οΈβ£+ Many"| L["π¦ Multi-Archive Menu<br/>π§© Parts Mode Β· π¦ Separate Unzip<br/>π§© Merge β Rezip Β· π§Ύ List Β· β Cancel"]
%% Non-archives only
H --> M["π Non-Archive Menu<br/>π Get Links (FTL) Β· π Make Archive<br/>π§Ύ List Β· β Cancel"]
%% Mixed
I --> N["π§© Mixed Menu<br/>π¦ Archive actions Β· π Links for non-archives<br/>π Zip everything Β· π§Ύ List Β· β Cancel"]
%% Password extraction flow (applies to archive menus)
K --> O{"π Protected archive?"}
L --> O
O -->|"Yes π"| P["π Ask user for password<br/>Store per session only"]
P --> Q["π¦ Retry extraction"]
O -->|"No β
"| R["π€ Upload extracted files"]
%% Remove password & send (optional after successful extraction)
R --> S{"π Remove password & send?"}
S -->|"Yes"| T["π Rezip without password<br/>Send new archive split if needed"]
S -->|"No"| U["β
Done"]
%% Zip flow (split uploads) from non-archive or mixed menus
M --> V{"π Make Archive chosen?"}
N --> V
V --> W["βοΈ Choose format + part size<br/>ZIP/7Z Β· 1900MiB/Custom"]
%% Add password to output archive (optional during zip settings)
W --> X{"π Add password to archive?"}
X -->|"Yes"| Y["π Ask password input<br/>Encrypt output archive"]
X -->|"No"| Z["π No encryption"]
W --> AA["π Create archive"]
AA --> AB["π€ Send parts<br/>part001 Β· part002 Β· ... β
"]
%% FTL flow from non-archive or mixed menus
M --> AC{"π FTL chosen?"}
N --> AC
AC --> AD["π Generate Stream + Direct links<br/>π Copy All / Paging"]
# Telegram
BOT_TOKEN=123:ABC
API_ID=123456
API_HASH=abcdef1234567890
# Access control
MAIN_GROUP_ID=-1009876543210
ADMIN_IDS=123456789,987654321
# Logs
LOGS_CHANNEL_ID=-1001234567890
LOGS_ENABLED=true
# Storage (example)
DB_PATH=./data/bot.db
DOWNLOAD_DIR=./downloadsAdmin Panel can change Main Group ID and Logs Channel ID at runtime (persist in DB).
- Primary UX = one Session Panel message edited throughout a session
- Authorization gate runs before creating/using Session Panel
- Membership check uses
getChatMember(MAIN_GROUP_ID, user_id)(bot must be in group) - Store Authorization List + runtime config in SQLite/JSON (persist across restarts)
/statsshows queue counts, not verbose per-job status- Admin Panel shows βwho is using botβ + lets admins manage auth/logs
- Logs are optional but strongly recommended for debugging + auditing