Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Telegram Multipurpose Bot

A feature-rich multipurpose Telegram bot with media downloading, search engines, text/image effects, URL shortener, news, sports scores, artistic effects, multi-language support, and configurable inline menus. Built with Go, uses BoltDB for persistence.

Features

πŸ“₯ Media Downloaders

Platform Formats
YouTube mp3, 360p, 720p, 1080p
Instagram Posts, reels
TikTok No watermark, HD, music audio
Facebook Dynamic quality selection
Pinterest Videos
Snapchat Stories, spotlight
Twitter/X Media downloads

πŸ” Search Engines

  • Pinterest Search β€” search and download images
  • Sticker Search β€” search stickers from API
  • Imgur Search β€” search and download images
  • YouTube Search β€” search videos with quick access links
  • Bing Search β€” web search and image search

🎨 Text & Image Effects

  • TextPro β€” styled text (Neon Light, Avengers, Pornhub Style, Harry Potter, and more)
  • Photooxy β€” photo effects (Battle 4, TikTok, and more)
  • Ephoto360 β€” ephoto effects (Wolf Galaxy, Free Fire Banner, Apex, and more)
  • Image Effects β€” blur, brightness, contrast, invert, grayscale, sharpen
  • Artistic Effects β€” pencil sketch, HDR, bokeh, thermal, X-ray, infrared, auto enhance

πŸ”— URL Shortener

  • Reurl, Tiny.cc, Its.sl, Cuq.in, Vurl, TinyURL

πŸ“° News

  • Google News (with search query), BBC, CNN, Al Jazeera, CGTN World, TRT World

⚽ Sports

  • Cricket, NFL, NBA, Cricbuzz

βš™οΈ General

  • Auto URL Detection β€” paste any supported link, bot auto-starts the download
  • Multi-Language β€” 13 languages (en, es, fr, de, hi, ur, sw, ha, yo, zu, am, af, ig)
  • Inline Keyboard Menus β€” contextual navigation with back buttons
  • Poll Creator β€” two-step flow: question then options (2–10)
  • Feedback System β€” free-text feedback stored with timestamps
  • User Tracking β€” first seen, last seen, name/username tracking
  • Admin Panel β€” total users and feedback count
  • Inline Mode β€” @botusername help and @botusername about
  • Concurrent Downloads β€” semaphore-limited (max 2), 100MB cap
  • Configurable API β€” base URL and API key via config.json or .env
  • Timezone-aware β€” configurable timezone for timestamps

Getting Started

1. Create a Telegram Bot

Open BotFather and send:

/newbot

Follow the prompts to choose a name and username. After creation, BotFather will give you an HTTP API token:

123456789:ABCdefGHIjklmNOPqrStuVWXyz-1234567890

Save this token β€” you'll need it for BOT_TOKEN.

2. Configuration

cp .env.example .env

Edit .env with your bot token and settings:

BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
ADMIN_IDS=123456789,987654321
API_BASE_URL=https://api.qasimdev.dpdns.org/api
API_KEY=qasim-dev
DB_PATH=/bot/data/bot.db

Environment Variables

Variable Required Description
BOT_TOKEN Yes Telegram Bot API token from BotFather
ADMIN_IDS No Comma-separated admin IDs (merged with config)
API_BASE_URL No Overrides apiBaseUrl in config.json
API_KEY No Overrides apiKey in config.json
DB_PATH No BoltDB file path (default: ./bot.db)

config.json

All bot settings live in config.json: bot info, owner, timezone, commands, UI buttons, API config, localization, and features. See the file directly for the full schema.

Key fields:

Field Description
bot.name Bot display name
bot.username Bot username (without @)
bot.photo Welcome image URL
owner.name Owner display name
owner.username Owner Telegram handle
owner.id Owner Telegram user ID (receives startup greeting)
timezone Timezone for timestamps (e.g. Asia/Karachi, UTC)
commands Enable/disable commands and set descriptions
adminIds Additional admin user IDs
apiBaseUrl Third-party API base URL
apiKey Third-party API key
ui.prefix Prefix shown on every message
ui.mainMenu.buttons Main menu button definitions
localization.defaultLanguage Fallback language
localization.supportedLanguages Available languages

3. Find Your User ID

Message @userinfobot β€” it will reply with your ID. Add it to adminIds in config.json or ADMIN_IDS in .env.

One-Line Install

Install and run in one command β€” the script will prompt for your BOT_TOKEN and start the bot automatically:

Platform Command
Linux / macOS bash <(curl -sL https://raw.githubusercontent.com/GlobalTechInfo/telegram-bot/main/install.sh)
Windows (PowerShell as Admin) iwr -useb https://raw.githubusercontent.com/GlobalTechInfo/telegram-bot/main/install.ps1 | iex
Termux pkg install curl -y && bash <(curl -sL https://raw.githubusercontent.com/GlobalTechInfo/telegram-bot/main/install.sh)

The installer will:

  1. Install Git and Go if missing
  2. Clone the repository
  3. Prompt for BOT_TOKEN (and optionally ADMIN_IDS, API_URL, API_KEY)
  4. Build the binary
  5. Create a system-wide shortcut (telegram-bot)
  6. Start the bot automatically

Deployment

Local (Direct)

Requirements: Go 1.25+

git clone https://github.com/yourusername/telegram-bot
cd telegram-bot
cp .env.example .env
# Edit .env with your BOT_TOKEN
go mod download
go build -o telegram-bot .
./telegram-bot

Docker

git clone https://github.com/yourusername/telegram-bot
cd telegram-bot
cp .env.example .env
# Edit .env with your BOT_TOKEN
docker compose up --build -d
docker compose logs -f

Systemd (Linux)

go build -o telegram-bot .
sudo mv telegram-bot /opt/telegram-bot/
sudo mkdir -p /opt/telegram-bot/data
sudo cp .env.example /opt/telegram-bot/.env
# Edit /opt/telegram-bot/.env with your BOT_TOKEN

Create /etc/systemd/system/telegram-bot.service:

[Unit]
Description=Telegram Multipurpose Bot
After=network.target

[Service]
Type=simple
Restart=always
RestartSec=5
WorkingDirectory=/opt/telegram-bot
ExecStart=/opt/telegram-bot/telegram-bot
EnvironmentFile=/opt/telegram-bot/.env

[Install]
WantedBy=multi-user.target

Enable and start:

sudo systemctl daemon-reload
sudo systemctl enable telegram-bot
sudo systemctl start telegram-bot

Cloud Hosts

Railway β€” Push to GitHub β†’ New Project β†’ Deploy from repo β†’ Add BOT_TOKEN env var

Render β€” New Web Service β†’ Connect repo β†’ Build: go build -o telegram-bot β†’ Start: ./telegram-bot β†’ Add BOT_TOKEN

Fly.io β€” fly launch β†’ fly secrets set BOT_TOKEN=your_token_here β†’ fly deploy

Commands

Command Access Description
/start Public Main menu with welcome message
/help Public List of commands
/settings Public Language changer, notification toggle
/profile Public Your user info
/feedback Public Send feedback
/about Public Bot info with timezone
/poll Public Create a poll
/yt Public Download YouTube videos
/ig Public Download Instagram posts/reels
/tt Public Download TikTok videos
/fb Public Download Facebook videos
/pin Public Download Pinterest videos
/sc Public Download Snapchat stories/spotlight
/tw Public Download Twitter/X posts
/bing Public Search the web or find images
/search Public Open search menu (Pinterest, Stickers, Imgur, YouTube, Bing)
/textmaker Public Open text maker menu (TextPro, Photooxy, Ephoto360)
/shorturl Public Open URL shortener menu
/news Public Open news menu
/sports Public Open sports scores menu
/imageeffect Public Apply effects to images
/artistic Public Artistic effects for images
/admin Admin Stats panel (users, feedback count)

Architecture

main.go                  Entry point β€” loads config/env, connects to Telegram, event loop
β”œβ”€β”€ config/config.go     Configuration loading, IsAdmin(), URL/key helpers
β”œβ”€β”€ handlers/handlers.go Command/callback/message handlers, all download/search/effect logic
β”œβ”€β”€ keyboards/keyboards.go Inline keyboard markup builders
β”œβ”€β”€ localization/localization.go i18n β€” 13 languages with English fallback
β”œβ”€β”€ session/session.go   BoltDB persistence (users, sessions, feedback, settings)
β”œβ”€β”€ config.json          Bot configuration (commands, UI, features, localization, API)
β”œβ”€β”€ .env                 Secrets (BOT_TOKEN, ADMIN_IDS, API config, DB_PATH)
└── .env.example         Template for .env
  • Language: Go 1.25+
  • Dependencies: go-telegram-bot-api/v5, bbolt (embedded)
  • Storage: Local BoltDB file β€” no external database required
  • API: Base URL + API key configurable via config.json or .env
  • Concurrency: Each update in its own goroutine; download semaphore (max 2)
  • Memory: 100MB per-download cap, explicit GC after large transfers
  • State Machine: Per-user state tracking for multi-step flows
  • Panic Safety: All goroutines have deferred panic recovery

Adding a New Language

  1. Add strings to the language map in localization/localization.go (all 13 languages)
  2. Get() falls back to English for missing keys (defensive only β€” define all keys)

Adding a New Feature

  1. Add handler logic in handlers/handlers.go
  2. Add localization strings in localization/localization.go (all 13 languages)
  3. Add keyboard if needed in keyboards/keyboards.go
  4. Register command + callback + state + auto-detect in handlers/handlers.go
  5. Add command + menu button in config.json

License

MIT

About

Telegram Multipurpose Bot

Topics

Resources

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages