Coder Social home page Coder Social logo

tg-last-message's Introduction

Last Telegram Message

This is a simple script that will fetch the latest message from a Telegram bot account and print it to stdout. This can then be used in something like i3blocks to display the message in your i3bar for example.

Setup

  1. Clone the repository
  2. Change directory to the repo and then edit the example config file to use your bot token.
  3. Install dependencies with npm
  4. Run the script
git clone https://github.com/Hoi15A/tg-last-message.git
cd tg-last-message
cp tg-config.example.json tg-config.json
vim tg-config.json
npm install
npm start

Config

The tg-config.json has 3 values that can be set:

  • token: This is your Telegram bot api token.
  • charLimit: This lets you set a maximum lenght for the output (set to -1 for no limit)
  • counter: Which is used to track the last seen Telegram message. You should never need to change this.

tg-last-message's People

Contributors

hoi15a avatar

Watchers

James Cloos avatar  avatar

Forkers

fuerbringer

tg-last-message's Issues

Allow setting a max message length

Currently the entire message will just be output as is.
There should be an option to limit how long this gets to avoid situations like this
long message in i3bar

Provide i3bar example configs

In the readme you mention This can then be used in something like i3blocks to display the message in your i3bar for example.. If you could provide some example configs in this repo on how to incorporate tg-last-message into the i3bar that'd be great.

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.