Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lensvol/teleword
https://github.com/lensvol/teleword
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lensvol/teleword
- Owner: lensvol
- License: mit
- Created: 2020-03-07T12:41:29.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-07T14:40:07.000Z (over 1 year ago)
- Last Synced: 2024-11-10T13:13:03.440Z (2 months ago)
- Language: Python
- Size: 76.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# teleword
![Supports Python 2.7](https://img.shields.io/badge/Python-2.7-yellow?logo=python&logoColor=white) ![Python 3.2 and above](https://img.shields.io/badge/Python-3.2%2B-blue?logo=python&logoColor=white) [![License](https://img.shields.io/github/license/lensvol/pybetter)](LICENSE) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
Single-file Telegram client for Python 3 without external dependencies.
## Premise
Sometimes you just need to send a simple Telegram message without the hustle of creating _virtualenvs_, installing necessary dependencies etc.
Why bother? Just grab `teleword.py` from this repo, `scp` it onto the machine and - voila! You can send messages and media from the command line!
## Features
* Uses only standard library.
* Works on Python 2.7, 3.2 - 3.12
* Can send text, photos and videos.
* Supports Markdown.## Prerequisites
* You need to [create Telegram bot](https://core.telegram.org/bots#6-botfather) first and get its token.
* Somehow find out your Telegram *chat_id*.
* Set `TELEGRAM_BOT_TOKEN` environment variable (or provide it via command line argument).## Example usage
Sending simple text:
```bash
python text "Hello, world!"
```Sending photo:
```shell
python photo cutest_cat.jpg --caption "_Cutest_ cat" --markdown
```Sending video:
```bash
python video chasing_own_tail.mp4 --caption "Check this out" --streaming
```## Usage
```bash
⇒ python teleword.py --help
usage: teleword.py [-h] [--token API_TOKEN] [--markdown] [--silent] [--force]
[--insecure] [--verbose] [--version]
CHAT_ID {text,photo,video} ...positional arguments:
CHAT_ID ID of the chat that should receive the message.
{text,photo,video} Types of messages that can be sent:
text Text message.
photo Photo.
video Video file.optional arguments:
-h, --help show this help message and exit
--token API_TOKEN Set Bot API token.
--markdown Use Markdown formatting for caption.
--silent Do not notify recipient of the message.
--force Skip sanity checks.
--insecure Skip certificate verification.
--verbose Log debug information.
--version show programs version number and exit
```## TODOs
* Support sending "media groups", audio.
* Shell completion.
* Chat ID retrieval mode.