Teleslurp is a command-line tool that allows you to search for and analyze Telegram users' activities across different groups and channels. It has built-in support for the TGScan API with Telegram's official API to provide comprehensive user information and message history.
- Go 1.16 or higher
- Telegram API credentials (API ID and API Hash)
- TGScan API key
- A Telegram account for authentication
go install github.com/gnomegl/teleslurpteleslurp search [username|user_id] [flags]Search for a Telegram user's activity across groups and channels. You can search using either:
- A username (e.g.,
teleslurp search johndoe) - A numeric user ID (e.g.,
teleslurp search 5338795474)
The tool will:
- Find the user's information and group memberships
- Crawl all accessible groups for messages from that user
- Export the results based on the specified format (JSON or CSV)
When using CSV or JSON export, each message will include:
- Channel Information:
- Title and username
- List of channel administrators (if accessible)
- Total member count
- When the target user joined the channel (if accessible)
- Message Details:
- Message ID and content
- Date and time
- Direct link to message
Note: Some channel information may be unavailable depending on your access level and the channel's privacy settings.
--api-hash stringTelegram API Hash (optional if already set in config)--api-id intTelegram API ID (optional if already set in config)--api-key stringTGScan API key (optional if already set in config)--input-file stringInput file containing Telegram channels/groups to search (CSV or text file)--csvExport results and channel metadata to CSV files-h, --helpHelp for search command--jsonExport results and channel metadata to JSON files--no-promptDisable interactive prompts
Note: When using --csv or --json, two files will be created:
username_messages.[csv|json]- Contains all messages foundusername_channel_metadata.[csv|json]- Contains detailed information about each channel
teleslurp monitor [flags]Monitor Telegram channels and groups in real-time, forwarding messages to target channels. This command runs continuously and requires a configuration file.
Create a monitor.config.yaml file in your config directory (~/.config/teleslurp/ on Linux/macOS or %APPDATA%\Local\teleslurp\ on Windows):
# Source channels to monitor
source_channels:
# Use numeric IDs (recommended)
- id: 1234567890
- id: 9876543210
# Username support planned (not implemented yet)
# - username: "@example_channel"
# Source groups to monitor
source_groups:
# Use numeric IDs (recommended)
- id: 1111111111
- id: 2222222222
# Username support planned (not implemented yet)
# - username: "@example_group"
# Target channels to forward messages to
target_channels:
# Use numeric IDs (recommended)
- id: 5555555555
# Username support planned (not implemented yet)
# - username: "@target_channel"
# User monitoring (planned feature, not implemented yet)
# monitor_users:
# - id: 666666666
# - username: "@user_to_monitor"- Real-time monitoring: Continuously monitors specified channels/groups for new messages
- Automatic forwarding: Forwards messages to target channels with attribution
- Database storage: Saves all forwarded messages to a local SQLite database
- Media support: Handles text, photos, and documents (with content protection awareness)
- Graceful shutdown: Handles SIGINT/SIGTERM for clean shutdown
- Username support: Monitor channels/groups using @usernames instead of numeric IDs
- User status monitoring: Track online/offline status and other user state changes
- Advanced filtering: Filter messages based on content, sender, or other criteria
- Multi-target forwarding: Forward to multiple target channels simultaneously
--api-hash stringTelegram API Hash (optional if already set in config)--api-id intTelegram API ID (optional if already set in config)--api-key stringTGScan API key (optional if already set in config)--config stringPath to monitor configuration file (default: config directory)--no-promptDisable interactive prompts-h, --helpHelp for monitor command
The monitor command automatically creates and maintains a SQLite database (teleslurp.db) in the same directory as your session files. This database stores:
- All forwarded messages with full metadata
- Channel information and member counts
- Message timestamps and URLs
- Unique constraints to prevent duplicates
Future database features:
- User status change history
- Advanced message filtering and search
- Monitoring statistics and analytics
teleslurp completion [shell]Generate shell completion scripts for bash, zsh, fish, or powershell.
teleslurp help [command]Get help about any command.
After the search completes, the tool displays a comprehensive summary:
For each channel with messages:
- Channel name and username/link
- Number of messages found
- Member count
- Date of user's first message
- Admin status
Overall statistics:
- Total number of channels with messages
- Total messages found
- Total members in channels
- Average messages per channel
When using CSV or JSON export, each message will include:
- Channel Information:
- Title and username
- List of channel administrators (if accessible)
- Total member count
- When the target user joined the channel (if accessible)
- Message Details:
- Message ID and content
- Date and time
- Direct link to message
The tool stores its configuration in the following locations:
- Windows:
%LOCALAPPDATA%\teleslurp\config.json - Linux/macOS:
~/.config/teleslurp/config.json
On first run, you'll be prompted to enter:
- TGScan API key
- Telegram API ID
- Telegram API Hash
- Phone number (during authentication)
- Your 2FA password (if applicable)
The --input-file flag allows you to specify a file containing Telegram channels or groups to search. The tool supports various input formats:
The tool will automatically detect and parse t.me links in any of these formats:
https://t.me/channelnamehttps://t.me/c/1234567890https://t.me/s/channelnamet.me/channelnamet.me/c/1234567890t.me/s/channelname
If no t.me links are found, each line in the file will be treated as either:
- A numeric channel ID (e.g.,
1234567890) - A channel username (e.g.,
channelname)
# Comments are supported
https://t.me/channel1
t.me/c/1234567890
t.me/s/channel2
channel3
1234567890
Note: The tool will attempt to resolve each entry to a valid Telegram channel or group. Invalid or inaccessible entries will be skipped with a warning message.
The tool implements reasonable delays between requests:
- 500ms between message searches
- 2 seconds between group searches
- github.com/spf13/cobra - CLI framework
- github.com/gotd/td - Telegram client implementation
- Standard Go libraries for HTTP requests and JSON handling
- Credentials are stored locally in the user's config directory
- Session data is encrypted and stored separately from configuration
- API keys and credentials are never logged or transmitted except to their respective services