Skip to main content

A simple library for sending messages and files via Telegram

Project description

py-telegram-sender

py-telegram-sender is a simple and convenient Python library for sending messages and files via a Telegram bot.

Installation

You can install py-telegram-sender using pip:

pip install py-telegram-sender

Usage

Basic Usage

from py_telegram_sender import TelegramSender

# Create a TelegramSender instance
sender = TelegramSender('YOUR_BOT_TOKEN', 'YOUR_CHAT_ID')

# Send a text message
sender.send_msg('Hello, world!')

# Send a file
sender.send_file('Here is a document', '/path/to/your/file.txt')

Using Backward Compatibility Functions

from py_telegram_sender import set_credentials, send_msg, send_file

# Set credentials
set_credentials('YOUR_BOT_TOKEN', 'YOUR_CHAT_ID')

# Send a text message
send_msg('Hello, world!')

# Send a file
send_file('Here is a document', '/path/to/your/file.txt')

Requirements

  • Python 3.6+
  • requests

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

We welcome contributions to the project! Please feel free to create an issue or pull request.  

Contact

If you have any questions or suggestions, please create an issue in this repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_telegram_sender-0.1.3.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_telegram_sender-0.1.3-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file py_telegram_sender-0.1.3.tar.gz.

File metadata

  • Download URL: py_telegram_sender-0.1.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for py_telegram_sender-0.1.3.tar.gz
Algorithm Hash digest
SHA256 79726e63b620c9425e01538c70af0fde3fa4969c8a1addb0d4e3d0517d634533
MD5 1c584f4cdeebcf7c76234c0e4395c070
BLAKE2b-256 0556095b5c559a2c73e0d733a29ee3315ec5c364f7f2404c170e8471f9478938

See more details on using hashes here.

File details

Details for the file py_telegram_sender-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for py_telegram_sender-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 024455b6c69539dd0b7452b4ab245aad827095680815d75719e625efbfd7953f
MD5 dbadf6229527ed138f42766e2e6f396e
BLAKE2b-256 14c558a0cc81f8907183071fcd02daea1e3147e5560266a85d3af732271cb081

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page