TgBotSender
Main
Nodejs
Python
Main
Nodejs
Python
  • Python

    • Imports
    • Getting started
    • Options for sending messages

Python

How to install ?

pip install tg-bot-sender

Imports

from tg_bot_sender import Data, TelegramSender

Getting started

The logs parameter indicates that logs are saved in json format

tg = TelegramSender(telegramToken, logs = False)

Response structure

{ "amount": 0 } // number of messages sent

Options for sending messages

sendFromIds - sending to users

tg.sendFromIds([...telegramUserIds], Data(
    text = 'Hello',
    photo = 'Photo link',
    buttons = [{
        buttonTitle: 'Hello',
        buttonUrl: 'https://google.com'
    }]
))

sendFromId - sending to the user

tg.sendFromIds(telegramUserId, Data(
    text = 'Hello',
    photo = 'Photo link',
    buttons = [{
        buttonTitle: 'Hello',
        buttonUrl: 'https://google.com'
    }]
))
Last Updated: 9/15/2024, 10:17:49 AM
Contributors: Кирилл