Giter Site home page Giter Site logo

tg-media-bot's Introduction

Telegram media bot

Tests Checks

Telegram bot written in rust for aliasing different media (currently only stickers are supported).

How it works

Initially, no aliases are specified. They can be added using /add command, which starts an addition process:

add_demo

After that, you can use specified aliases enclosed in colons in your messages. The bot will send the associated media to the chat:

replacing_demo

Usage

The bot is (hopefully still) running at http://t.me/textmedia_bot.

  • Add it to a chat (or start a conversation in PM)
  • (If using in chat) Give admin rights if you wish all messages in the chat to be seen.
  • Use it according to /start and /help

How to run it by yourself

Requirements

  • Rust/Cargo 1.56+
  • Redis 6.2+

Older versions may work, however they were not tested.

Usage

You can download precompiled binaries from releases page or build the project by yourself.

Before launching the bot make sure to

  • Start redis server
  • Specify bot API token in TELOXIDE_TOKEN enviromental variable

Using precompiled binary

  • Download binary for your platform from releases page
  • Unpack it
  • Launch from command line

Manual building

  • Type cargo install --git https://github.com/bragov4ik/tg-media-bot.git
  • Run the bot using tg-media-bot command (if cargo installation folder is in your PATH)

Or compile using any other method like cargo run --release

Arguments

There is one optional argument - Redis address. You should specify only the address itself, without redis:// prefix.

Usage example: tg-media-bot 127.0.0.1

Bugs/problems

If any bugs related to the code were found, create an issue with its description.

Planned work/features

Kind of sorted according to importance (higher - more preferable)

  • add proper (unit) tests
  • add support for any media
  • inline search
  • more elegant way to handle common commands
  • marking symbol specification (colons may cause conflict) however can be avoided right now by not giving admin rights to the bot, so it does not see all the messages
  • resolve TODOs (not critical, just better practices)

tg-media-bot's People

Contributors

bragov4ik avatar

Watchers

 avatar

tg-media-bot's Issues

The bot doesn't recognize commands with bot alias

Expected behaviour:
Bot reacts to supported commands targeted to it with its alias (for example, /list@bot_name).

Actual behaviour:
Bot ignores such commands, reacts only to commands without any name (/list is ok, /list@bot_name is not)

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.