• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Introducing Telepipe: Your New Favorite CLI for Telegram Notifications & File Sharing

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
Level up your command-line productivity with Telepipe, a nifty utility that bridges your terminal directly to your Telegram chats!

Are you a developer, sysadmin, or just someone who practically lives in the terminal? Ever wished for a super simple way to send quick messages, command outputs, or even entire files to a Telegram chat, group, or channel without breaking your workflow? If so, Telepipe is the tool you've been waiting for.

What is Telepipe?


Telepipe is a simple command-line utility to send messages or files to Telegram chat directly from your terminal. Whether you want to get notifications from your scripts, share log files, or just pipe the output of a command, Telepipe handles it seamlessly.

The Pain Point: Terminal-to-Telegram Bridging


Often, you're working on a server or deep in your local development environment, and you need to quickly share information. Maybe a long-running script has finished, a backup has completed (or failed!), or you just want to send a text snippet. Switching to a GUI app or fumbling with complex API calls can be a drag. Telepipe eliminates this friction.

Key Features of Telepipe:

  • Versatile Messaging: Send messages to Telegram channel/chat/group directly from command line.
  • Smart File Handling: Automatically switch between message and file mode based on content length. The default threshold is 4096 characters, but this is configurable.
  • Shareable Links: Generate shareable Telegram links.
  • Guided Installation: Easy installation with guided setup. The installer.sh script walks you through the setup, including dependency checks (it needs curl).
  • Simple Configuration: A straightforward configuration file (/etc/telepipe/config) holds your Bot Token, Chat ID, and other preferences.
  • Customizable: You can set:
    • BOT_TOKEN: Your unique Telegram Bot Token from BotFather.
    • CHAT_ID: The target chat, group, or channel ID.
    • MAX_LEN: The character limit before switching to file mode (defaults to 4096).
    • TIMEOUT: API request timeout in seconds (defaults to 5).
    • DISABLE_LINK_PREVIEW: Option to disable link previews in messages (defaults to true).
How it Works (Under the Hood)


Telepipe is a Bash script that uses curl to interact with the Telegram Bot API. During installation, it prompts you for your Bot Token and Chat ID, storing them securely in a configuration file. When you pipe data to Telepipe or use it with cat, it reads the standard input, checks the length, and then constructs the appropriate API request to either send a message or upload a document.

Installation Made Easy


Getting Telepipe up and running is simple:


  1. Clone the Repository:

    git clone

    Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.


    cd telepipe

  2. Run the Installer:

    chmod +x installer.sh
    sudo ./installer.sh

The installer will:
* Check if you're running as root/sudo.
* Create necessary directories (/etc/telepipe, /usr/local/bin).
* Check for and offer to install curl if it's missing.
* Prompt you for your Telegram Bot Token and Chat ID.
* Allow you to customize MAX_LEN, TIMEOUT, and DISABLE_LINK_PREVIEW settings.
* Create the configuration file (/etc/telepipe/config) and the main telepipe script in /usr/local/bin.
* Set appropriate permissions for the script and config file (config is chmod 600).
* Test the connection to the Telegram API.

Using Telepipe - It's a Pipe Dream!


The beauty of Telepipe lies in its simplicity, leveraging standard Unix pipes:


  • Show Help:

    telepipe --help

  • Show Version:

    telepipe --version

  • Send a Simple Message:

    echo "Hello from my server!" | telepipe

  • Send Command Output:

    uptime | telepipe

  • Send File Contents:

    cat my_log_file.txt | telepipe

  • Integrate into Your Scripts:

    backup_my_database() {
    # Your backup logic here...
    if [ $? -eq 0 ]; then
    echo "Database backup completed successfully at $(date)" | telepipe
    else
    echo "Database backup FAILED at $(date)!" | telepipe
    fi
    }

Upon successful sending, Telepipe will output a shareable Telegram link to the message or indicate success if it's a direct message.

Configuration Details


You can tweak Telepipe's behavior by editing /etc/telepipe/config:

  • BOT_TOKEN: Your Telegram bot token (get from

    Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

    on Telegram).
  • CHAT_ID: The ID of the chat, group, or channel. For channels/groups, this often starts with -100.
  • MAX_LEN: Max message length before sending as a file (default: 4096).
  • TIMEOUT: API request timeout in seconds (default: 5).
  • DISABLE_LINK_PREVIEW: Whether to disable link previews (default: true).
Why Telepipe?

  • Simplicity: No complex dependencies or bloated clients. Just a Bash script and curl.
  • Efficiency: Stay in your terminal and automate notifications with ease.
  • Flexibility: Send anything from simple text to entire files.
  • Open Source: Licensed under MIT, so feel free to use, modify, and contribute!
Get Started with Telepipe Today!


Stop context-switching and start integrating Telegram seamlessly into your command-line workflows.

Find it on GitHub:

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Contributions, feedback, and feature requests are always welcome!


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу