Giter Club home page Giter Club logo

clojurebot's Introduction

ClojureBot

ClojureBot is a Telegram bot that lets you evaluate your own Clojure expressions, anywhere, anytime.

Usage

You'll need to get your own Telegram API key.

ClojureBot uses Environ, so you should set your api-key environment variable to your own key.

If you are running the bot using leiningen, you can add your key to your profiles.clj file, like so:

{:dev
 {:env {:api-key "your-api-key"}}}

ClojureBot also uses clojail. From the README:

Because clojail employs the JVM's built in sandboxing, you'll need to have a ~/.java.policy file to define permissions for your own code. If you don't do this, you'll get security exceptions. I've included a very liberal example.policy file that you can just copy over to ~/.java.policy.

Then, just lein run inside your project folder.

Limitations

All the clojure code you pass to the bot is evaluated in a sandbox.

This specific implementation disallows the creation of defs and all filesystem and network access. Long-running processes will be terminated (issuing a Timeout Exception).

You can override this by changing the tester used in sandbox.clj.

Just change the clj-telegrambot-tester variable to include your preferred clojail tester.

License

Copyright © 2015 Borja de Régil.

The use and distributon for this software are covered by the Eclipse Public License 1.0.

See also LICENSE

ClojureBot includes code from clj-slackbot, which is
Copyright © 2014 Uday Verma. Licensed under the same terms as Clojure (EPL).

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.