Giter Site home page Giter Site logo

katybot's Introduction

Code walkthrough

If you’re interested in learning Clojure, read source code walkthrough here: http://tonsky.livejournal.com/255587.html

Starting

Best way to start Katybot is to use lein repl, this way repl.clj will be loaded automatically with a bunch of useful fns.

To test Katybot in console:

katybot.repl=> (listen-console)

To run her in Campfire, define following env variables before runnig lein repl:

~/katybot/$ export KATYBOT_CAMPFIRE_ACCOUNT=... # account is your third-level domain on campfirenow.com
~/katybot/$ export KATYBOT_CAMPFIRE_ROOM   =...
~/katybot/$ export KATYBOT_CAMPFIRE_TOKEN  =...
~/katybot/$ export KATYBOT_CAMPFIRE_ALIASES="/|Kat[ey]|robot"
~/katybot/$ lein repl

katybot.repl=> (listen-campfire)

Using

Bot answers to commands starting from aliases, by default they're Kate, Katy and /:

> Kate, hello!
< Nice to see you again
> /hi
< Nice to see you again

To see list of all available command use help:

> /help
< stop      — ask bot to shutdown gracefully
  calc me   — ...
  ...

Stopping

To make her exit, tell her stop:

> /stop
< I’m out

or type an empty string (console only).

Extending

Take a look at reflexes directory for hints on how to implement your own extension scripts. katybot.repl/reload-reflexes scans reflexes and its sub-directroies and loads every .clj file as an robot’s extension script.

Extensions could be reloaded on the fly, without stopping robot. Just evaluate:

katybot.repl=> (reload-reflexes)

katybot's People

Contributors

tonsky avatar

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.