Getting Started

Kenneth Endfinger edited this page Nov 5, 2015 · 10 revisions

Adding the Dependency

Add the following to your pubspec.yaml

  irc: "^3.0.1"

After that, run pub get

Use the Library

From v3.0.0, irc.dart now supports user objects, which are global across the client. This means you don't have to deal with nicknames anymore.

import "package:irc/client.dart";

// This stores our configuration for this client
var config = new Configuration(host: "", port: 6667, nickname: "DartBot", username: "DartBot");
// "Primary" IRC class
var client = new Client(config);

main() async {
  // Register an onReady event handler
  client.onReady.listen((event) {
    // Join a channel

  // Register an onMessage event handler    
  client.onMessage.listen((event) {
    // Log any message events to the console
    print("<${}><${}> ${event.message}");

  // Connect to the server
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.