Skip to content
Kenneth Endfinger edited this page Jun 24, 2014 · 13 revisions

Adding the Dependency

Add the following to your pubspec.yaml

dependencies:
  irc: ">=1.0.0 <2.0.0"

After that, run pub install

Import the Library

import 'package:irc/irc.dart';

Use the Library

var config = new BotConfig(
  nickname: "DartExampleBot",
  host: "irc.esper.net",
  port: 6667
);

var bot = new CommandBot(config);

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

bot.command("hello").listen((CommandEvent event) {
  event.reply("> Hello World!");
});

bot.connect();
Clone this wiki locally