An open API service indexing awesome lists of open source software.

https://github.com/alex5402/telegram-cli

A telegram cli tool to upload files and send message on telegram using telegram id
https://github.com/alex5402/telegram-cli

telegram telegram-api telegram-cli

Last synced: 4 months ago
JSON representation

A telegram cli tool to upload files and send message on telegram using telegram id

Awesome Lists containing this project

README

          

# πŸš€ Telegram CLI Tool

A simple and efficient command-line interface (CLI) tool for interacting with Telegram. This project is built using Python and packaged into a standalone executable using PyInstaller.

---

## πŸ“‹ Features

- πŸ“€ Send text messages
- πŸ“ Send files with optional descriptions
- 🌐 Works with private chats, groups, and channels
- πŸ”’ Secure and lightweight executable

---

## πŸ› οΈ Build Instructions

Follow these steps to build the project into a standalone executable:

### Prerequisites

1. 🐍 **Python 3.8+**
2. πŸ“¦ Required dependencies (install via `requirements.txt`):
```bash
pip install -r requirements.txt
```
3. πŸ› οΈ **PyInstaller**:
```bash
pip install pyinstaller
```

### Building the Executable

1. Clone the repository and navigate to the project directory.
2. Run the following command to build the executable:
```bash
make
```

### Cleaning Up

To remove build artifacts and temporary files:
```bash
make clean
```

---

## πŸ“¦ Generated Executable

- The standalone executable will be located in the `dist` folder after the build process.
- Run the executable using:
```bash
./dist/telegram-cli
```

---

## πŸ”§ Usage

Here’s how to use the CLI tool:

### Sending a Text Message
```bash
./dist/telegram-cli -p -t "Hello, this is a test message!"
```

### Sending a File with Description
```bash
./dist/telegram-cli -g -F /path/to/file.txt -d "File description here."
```

### Available Options

| Option | Description |
|------------------|-----------------------------------|
| `-p ` | Send to a private user |
| `-g ` | Send to a group |
| `-c `| Send to a channel |
| `-t ` | Text message to send |
| `-F ` | File path to send |
| `-d `| Description for the file (optional)|

---

## πŸ“‚ File Structure

```plaintext
β”œβ”€β”€ telegram-cli.py # Main script
β”œβ”€β”€ requirements.txt # Dependencies
β”œβ”€β”€ Makefile # Build automation
β”œβ”€β”€ dist/ # Generated executables
└── README.md # Project documentation
```

---

## 🌟 Contributions

Contributions are welcome! Feel free to open issues or submit pull requests. 😊

---

## πŸ“œ License

This project is licensed under the MIT License. See `LICENSE` for details.

---

## 🀝 Acknowledgments

- Built with ❀️ using [Telethon](https://docs.telethon.dev/)
- Packaged with πŸ› οΈ [PyInstaller](https://www.pyinstaller.org/)

---

## πŸš€ Let's Build Together!

If you find this project helpful, please ⭐ it and share it with others! πŸ’–