Skip to content

ergl/clojurebot

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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).

About

ClojureBot - A remote REPL inside Telegram

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published