Dart IRC Build Status

The Beautiful IRC Library for Dart

Report any issues here!

Links

Contributing

See the Contributing Guide.

Design

irc.dart is designed to work out of the box in a very configurable way.

  • Builtin Bot System
  • Ability to create your own bots
  • Easy to Understand API
  • Makes use of a lot of Language Features
  • Use only what you need
  • Event-based System

Bots

Command Bot

The command bot is just a normal bot implementation of commands.

import 'package:irc/irc.dart';

void main() {
  BotConfig config = new BotConfig(
    host: "irc.esper.net",
    port: 6667,
    nickname: "DartBot",
    username: "DartBot"
  );

  CommandBot bot = new CommandBot(config, prefix: ".");

  bot.register((ReadyEvent event) {
    event.join("#directcode");
  });

  bot.command("help").listen((CommandEvent event) {
    event.reply("> ${Color.BLUE}Commands${Color.RESET}: ${bot.commands.keys.join(', ')}");
  });

  bot.connect();
}

Dumb Bot

This bot just prints messages to the console.

import 'package:irc/irc.dart';

void main() {
  BotConfig config = new BotConfig(
    host: "irc.esper.net",
    port: 6667,
    nickname: "DartBot",
    username: "DartBot"
  );

  CommandBot bot = new DumbBot(config);

  bot.register((ReadyEvent event) {
    event.join("#directcode");
  });

  bot.connect();
}

Library

There is also a plain library to write your own IRC Bots!

import 'package:irc/irc.dart';

void main() {
  BotConfig config = new BotConfig(
    host: "irc.esper.net",
    port: 6667,
    nickname: "DartBot",
    username: "DartBot"
  );

  Client client = new Client(config);

  client.register((ReadyEvent event) {
      event.join("#directcode");
  });

  client.connect();
}

Libraries

irc
irc.bot
irc.parser