LinuxCommandLibrary

tgsend

Send Telegram messages via bot API

TLDR

Send message

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

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 sends messages via Telegram Bot API, useful for notifications and automation.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community