Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
/ tepe Public archive

Telegram bot CLI for sending messages and files

License

Notifications You must be signed in to change notification settings

Hermitter/tepe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tepe

Crate

Wondering if your build finished? Tepe is a CLI that lets you command a bot to send messages and files over Telegram.

Installation

1. Download Tepe

Installing from source/crates.io requires Rust on your computer. Linux users will also need to have openssl dev files installed.

  - Debian: sudo apt install libssl-dev
  - Fedora: sudo dnf install openssl-devel
  - Alpine: sudo apk add openssl-dev

Install Tepe from one of the following:

cargo install tepe
  • Source
git clone https://github.com/Hermitter/tepe && cd tepe
cargo install --path .
# Currently built for x86_64 Linux, Windows, and macOS.
# linux x86_64 setup example
curl -L https://github.com/Hermitter/tepe/releases/latest/download/tepe-x86_64-unknown-linux-musl -o tepe
chmod +x ./tepe

2. Create Your Bot and Save the Token

Talk to @Botfather and go through some dialog options until you've successfully created a bot. You should receive a token in the format of 123456789:blablabla

Export the token by exposing it as an environmental variable

# Unix-like
export TEPE_TELEGRAM_BOT_TOKEN=__Place_Bot_Token_Here__
# Windows
set TEPE_TELEGRAM_BOT_TOKEN=__Place_Bot_Token_Here__

3. Find the Chat ID with your Bot

You can start talking to your bot by visiting (https://t.me/YOUR_BOT_NAME_HERE).

Once inside the chat, run the following command. The bot will print the chat_id of any chatroom that messages it.

tepe test

Example output:

*********************************************************************
Your Telegram bot is now running! Try sending it a message on Telegram.
On success, the chat_id is printed.

Press Ctrl+c to exit.

Successful reply from chat_id: 923567462
*********************************************************************

4. Send Messages

TEPE_TELEGRAM_CHAT_ID can be set to avoid setting the same chat_id every time

You're now ready to send messages!

Example command:

tepe send -c 923567462 ./shopping_list.txt ./some_photo.png -m "here are your things"
USAGE:
    tepe send [OPTIONS] [--] [files]...

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -c, --chat <chat_ids>...    Specifies a new Telegram chat id. This will not ignore the TEPE_TELEGRAM_CHAT_ID
                                variable.
    -m, --message <message>     String to pass into a Telegram message.
    -t, --token <token>         Sets the Telegram bot token. This ignores the TEPE_TELEGRAM_BOT_TOKEN variable.

ARGS:
    <files>...

About

Telegram bot CLI for sending messages and files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages