irc 1.2.6 copy "irc: ^1.2.6" to clipboard
irc: ^1.2.6 copied to clipboard

outdated

A feature-full Dart IRC library

Dart IRC Build Status #

The Beautiful IRC Library for Dart

Report any issues here!

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();
}
6
likes
0
points
111
downloads

Publisher

unverified uploader

Weekly Downloads

A feature-full Dart IRC library

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

event_dispatcher

More

Packages that depend on irc