Coder Social home page Coder Social logo

telegrammer's Introduction

Telegrammer

telegrammer demo

Telegrammer is a command-line interface (CLI) tool written in Go that allows you to send messages or documents to a specified user on Telegram, as well as retrieve your user ID for configuration by running in server mode. It uses the Telegram Bot API to send messages and documents.

Features

  • Send text messages to a specified user on Telegram.
  • Send documents to a specified user on Telegram.
  • Retrieve your user ID for configuration by running in server mode.
  • Configurable through environment variables or a configuration file.
  • Provides visual feedback on successful message delivery.

Installation

To install Telegrammer, you need to have Go installed on your machine. Once you have Go set up, you can install Telegrammer with:

go get github.com/sixlive/telegrammer

or head over to the releases to download a pre-compiled binary.

Usage

To use Telegrammer, you need to have a Telegram bot token and the user ID of the recipient. You can set these through environment variables or in a YAML configuration file. Additionally, you can run Telegrammer in server mode to listen for new messages and find your user ID for configuration.

Environment Variables

  • TELEGRAMMER_BOT_KEY - Your Telegram bot token.
  • TELEGRAMMER_USER_ID - The user ID of the recipient.

Configuration File

You can also provide a configuration file in YAML format. The file should have the following structure:

yaml bot_key: your_bot_token user_id: recipient_user_id

You can place the configuration file in the following locations:

  • $HOME/.config/telegrammer/config.yaml
  • ./config.yaml (in the same directory as the Telegrammer binary)

Command-Line Flags

  • -f, --file - Path to the file you want to send.
  • --server - Run in server mode to listen for new messages and find your user ID.

Examples

Send a text message:

telegrammer "Hello, world!"

Send a document:

telegrammer -f /path/to/document.pdf "Here's the document you requested."

Find your user ID by running in server mode:

telegrammer --server

Contributing

Contributions to Telegrammer are welcome! Please submit a pull request or create an issue if you have any features you'd like to add or bugs you've found.

License

Telegrammer is licensed under the MIT License. See LICENSE for more information.

telegrammer's People

Contributors

sixlive avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

telegrammer's Issues

Server usage removes existing bot webhook

Using the listener will detach any existing webhook assigned to your chatbot rather than temporarily overriding.

We either need to document the warning or allow for temporary override

Installer

Continue to use charm, maybe create a small bubble tea install sub command. This could use the listener automatically walk your through the setup, inspect the response, automatically set your key

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.