Skip to main content

A Python package to send messages and images to Telegram groups using 'requests' package only.

Project description

Telegramy

Telegramy is a lightweight Python package designed for sending messages and images to Telegram groups with ease. This package provides a simple interface for interacting with Telegram, relying only on the requests library to communicate with Telegram's Bot API.


Features

  • Send Text Messages: Easily send text messages to Telegram groups.
  • Send Images: Quickly share images with group members.
  • Lightweight: No unnecessary dependencies—built with only requests.
  • Simple Configuration: Set up using your Telegram bot token and group chat ID.

Installation

You can install Telegramy via pip:

pip install telegramy

Creating a Telegram Bot

  1. Open Telegram and search for @BotFather.
  2. Start a chat with @BotFather and send the command /newbot.
  3. Follow the on-screen instructions to:
    • Name your bot.
    • Choose a unique username for your bot.
  4. Once the bot is created, @BotFather will provide you with a token to access the Telegram HTTP API.
  5. Copy the token and use it as the token parameter when initializing the Sender class in Telegramy.

Retrieving a Chat ID

  1. Log in to Telegram Web in your browser.
  2. Open the chat you want to retrieve the ID for.
  3. Look at the URL in your browser’s address bar. It should look something like this:
    https://web.telegram.org/a/#-132132132.
  4. Extract the part after the # symbol (e.g., -132132132).
  5. Replace the prefix #- with -100. For example:
    #-132132132-100132132132.
  6. Use the final result (e.g., -100132132132) as your chat ID when sending messages with your bot.

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

telegramy-0.0.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

telegramy-0.0.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file telegramy-0.0.2.tar.gz.

File metadata

  • Download URL: telegramy-0.0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for telegramy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7f6160a6919c02eb565a4af609c1804beccf9c6065c258c2cbefdd7dab813587
MD5 84c38a91a4e3afe307eab834a2a13a47
BLAKE2b-256 f3343a0a668d30fb767038d9f129b52df3045a371d7148e684176b5325aafb06

See more details on using hashes here.

File details

Details for the file telegramy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: telegramy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for telegramy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f678c268822a1b86e44e19283a85f9aaf376683c69519d7aa1fbb4f52a3f54bc
MD5 9d2c875f2fd6d8df73a50c4a35296cae
BLAKE2b-256 dd809ece504124403987606eb545b538e05e842cd55c727a0bae3234938ed564

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