web_app_tg_bot v0.1.0

Telegram bot that provides local and public IP addresses

Get your local and public IP addresses with web access URLs. Interactive inline keyboard navigation, simple and user-friendly interface.

Python Telegram Bot aiogram Async Utility

web_app_tg_bot — a Telegram bot that provides local and public IP addresses with web access URLs. Interactive inline keyboard navigation, simple and user-friendly interface.

  • 🔍 Get local IP address — with port information
  • 🌐 Get public IP address — with port information
  • 🎨 Interactive inline keyboard — easy navigation
  • 📱 Simple and user-friendly — intuitive interface
  • ⚡ Asynchronous operation — better performance

  • Python 3.8 or higher
  • Telegram Bot Token (from @BotFather)
  • Internet connection for public IP lookup

# Clone the repository
git clone https://github.com/aixandrolab/web_app_tg_bot.git
cd web_app_tg_bot

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Create a .env file in the root directory:

# Telegram Bot Token (required)
TOKEN=your_telegram_bot_token_here

# Application Settings
PORT=8000
WEB_APP_TITLE=🌐 IP Address Bot
WEB_APP_DESCRIPTION=Get your local and public IP addresses with web access URLs
VariableDescriptionRequiredDefault
TOKENTelegram Bot API token from @BotFatherYes-
PORTPort number for web access URLsNo8000
WEB_APP_TITLETitle displayed in bot messagesNo"🌐 IP Address Bot"
WEB_APP_DESCRIPTIONDescription text in welcome messageNo-

web_app_tg_bot/
├── .env                    # Environment variables
├── .gitignore             # Git ignore file
├── bot.py                # Main bot application
├── utils/
│   └── get_ip.py          # IP address utilities
├── requirements.txt       # Python dependencies
└── README.md             # Documentation

Start the bot:

python bot.py

Interact with the bot on Telegram:

  • Send /start command
  • Click "Get local IP-url" to see your local IP
  • Click "Get public IP-url" to see your public IP
  • Use "⬅ Back" button to return to main menu

  • Local IP Detection: Uses UDP socket connection to 8.8.8.8 to determine the local network interface IP
  • Public IP Detection: Fetches public IP from ipify.org API
  • Bot Interface: Provides interactive buttons for easy navigation

  • Returns None if IP detection fails
  • Logs errors to console for debugging
  • Graceful failure without bot crashes

  • Exposing local IP addresses can be a security risk
  • Recommended for internal network use only
  • Don't expose this bot to public if local IP contains sensitive information
  • Consider adding authentication for production use

By using this software, you agree to the full disclaimer terms.

Software provided "AS IS" without warranty. You assume all risks.

Full legal disclaimer: See DISCLAIMER.md

License: BSD 3-Clause License

Links


Created by Aixandrolab

Copyright © 2026, Alexander Suvorov. All rights reserved.