web_app_tg_bot

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.


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.