sixlive / telegrammer

Minimal app to use Telegram from the CLI for notifications
4 stars 1 forks source link

Telegrammer

telegrammer demo

Telegrammer is a command-line interface (CLI) tool written in Go that allows you to send messages or documents to a specified user on Telegram, as well as retrieve your user ID for configuration by running in server mode. It uses the Telegram Bot API to send messages and documents.

Features

Installation

You can download Telegrammer from the releases page.

Or install with go:

go install github.com/sixlive/telegrammer

Usage

To use Telegrammer, you need to have a Telegram bot token and the user ID of the recipient. You can set these through environment variables or in a YAML configuration file. Additionally, you can run Telegrammer in server mode to listen for new messages and find your user ID for configuration.

Environment Variables

Configuration File

You can also provide a configuration file in YAML format. The file should have the following structure:

yaml bot_key: your_bot_token user_id: recipient_user_id

You can place the configuration file in the following locations:

Command-Line Flags

Examples

Send a text message:

telegrammer "Hello, world!"

Send a document:

telegrammer -f /path/to/document.pdf "Here's the document you requested."

Find your user ID by running in server mode:

telegrammer --server

Contributing

Contributions to Telegrammer are welcome! Please submit a pull request or create an issue if you have any features you'd like to add or bugs you've found.

License

Telegrammer is licensed under the MIT License. See LICENSE for more information.