tgsend

Send Telegram messages via bot API

TLDR

Send message
$ tgsend "[message]"
Send to specific chat
$ tgsend -c [chat_id] "[message]"
Send file
$ tgsend -f [document.pdf]
Send image
$ tgsend -p [image.jpg]
Send with caption
$ tgsend -p [image.jpg] -m "[caption]"
Silent message
$ tgsend -s "[message]"

SYNOPSIS

tgsend [-c chatid] [-f file] [-p photo] [options] [message_]

DESCRIPTION

tgsend sends messages, files, and photos to Telegram chats using the Telegram Bot API. It is designed for automation and scripting, enabling notifications, alerts, and file delivery from the command line or cron jobs.Messages can be sent to specific chats using their ID, and media attachments can include captions via the -m flag. The -s flag sends messages silently without triggering a notification on the recipient's device. A bot token is required and can be passed via the -t flag or environment configuration.

PARAMETERS

-c ID

Chat ID.
-f FILE
Send file.
-p FILE
Send photo.
-m TEXT
Caption text.
-s
Silent mode.
-t TOKEN
Bot token.

CAVEATS

Bot token required. Chat ID needed. Rate limits apply.

HISTORY

tgsend is a lightweight CLI tool for sending messages via the Telegram Bot API, commonly used for alerting and automation in DevOps workflows.

SEE ALSO

telegram-desktop(1), curl(1)