Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tiny personal IRC bot
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
config
lib
Readme.textile
dart.rb

Readme.textile

Dart

Dart is a tiny personal IRC bot.

Unlike most bots, the only functionality Dart comes with is the ability to connect to a server. It’s up to you to add commands using simple YAML building blocks (like executing a shell command).

Requirements

You’ll need the summer gem, which is an ultra-lightweight IRC framework.

Configuration

To configure Dart, copy config/summer.yml.example to config/summer.yml.

Tell Dart where to connect using server, nick and channels.

owner will be inserted into the regular expression /^owner$/i and should match any hostmasks (e.g. “Wheaties!wheaties@example.com”) Dart should respond to. Remove owner to have Dart respond to anyone.

commands is a hash of command names and associated actions. You may use YAML’s &anchors and *references to create “aliases” for your commands.

Actions

Each action has a type, and most types of actions have some additional options.

Actions can access arguments passed to commands. %0 will be substituted with the entire argument string, and %1, %2, ... are substituted with individual arguments (or an empty string).

shell, term, terminal

Dart executes command in a subshell.

command The shell command to execute

message

Dart sends message as an IRC PRIVMSG.

message The message to send
to The message target (optional)

notice

Dart sends message as an IRC NOTICE.

message The notice to send
to The notice target (optional)

ruby

Dart executes code using Ruby’s eval method and prints the result.

code Code to execute
silent If set, will not print result (optional)
to Where to send the result (optional)

quit

Dart disconnects from the server and exits.

Usage

Tell Dart to execute a command by addressing him in IRC:

<Wheaties> dart: echo my hovercraft is full of eels
<dart> my hovercraft is full of eels
Something went wrong with that request. Please try again.