Giter VIP home page Giter VIP logo

glgbot's Introduction

glgbot

BITCH, DAB

How to use:

$ echo -n "$TELEGRAM_API_TOKEN" > bot.token
$ git clone https://github.com/j0sh/ocaml-gensqlite   # The OPAM package is broken...
$ cd ocaml-gensqlite && make && make install && cd .. # Just compile from source yourself, for now
$ oasis setup -setup-update dynamic
$ make
$ ./bot.native

Customizing glgbot:

In order to add new commands, you can use the interface provided by Api.Command. Your bot module should contain a commands : Api.Command.command list. For a basic example of two of these types of commands, see src/bot.ml.

Documentation:

Some (poorly generated) documentation for the Telegram API implementation is provided at the Github project site. Alternatively, you can just browse through src/api.mli to view this same information as part of the module signature.

glgbot's People

Contributors

nv-vn avatar

Stargazers

Thomas Gazagnaire avatar Seb Mondet avatar  avatar

Watchers

James Cloos avatar  avatar

glgbot's Issues

Make command parsing better

Currently, if two commands start the same way the first one will always be selected. We should allow command names to contain other command names.

Add sound messages

Respond to /gnuwith the GNU song and /ocaml with the OCaml rap as audio messages

Separate API from bot

Split the implementation of the Telegram Bot API into its own repository and host to OPAM.

Allow run-time command changes?

Options:

  • Don't allow commands to be changed at runtime
  • Allow for commands to be added removed by mutable list
  • Mutable enabled : bool field for command type

Add `/jukebox`

Needs a /jukebox command to add searchable mp3s to the database

Update file-sending

  • Add sending events for audio/voice
  • Switch to having SendAudio/SendVoice and ResendAudio/ResendVoice
  • Add events for images, documents, etc.
  • Return file_id from JSON returned
  • Fix action values to take 'a -> action Lwt.t or 'a -> action

Switch to passing limited version of the Bot module to commands

Currently, commands work with the Command.action type to give the command handler a set of actions to run from a predefined set of possibilities. It might be beneficial to switch to a system where a small module containing the actual functions here is passed to the command as a first-class module.

Corruption for uploads using carriage returns

Currently, we rely on Lwt_io.lines_of_file for reading files to upload. The problem is that this splits based on /\r?\n/ rather than just on /\n/, so carriage returns are effectively thrown away when the string gets folded back together (adding "\r\n" is not a solution since this only occurs in some places). For binary formats like OGG, this causes the uploaded file to become partially corrupted where the carriage returns occur.

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.