irc 1.2.2-dev.2 copy "irc: ^1.2.2-dev.2" to clipboard
irc: ^1.2.2-dev.2 copied to clipboard

outdated

A feature-full Dart IRC library

example/example.dart

import 'package:irc/irc.dart';
import 'dart:io';

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.commandNames().join(', ')}");
  });

  bot.command("dart").listen((CommandEvent event) {
    event.reply("> Dart VM: ${Platform.version}");
  });

  bot.register((BotJoinEvent event) {
    print("Joined ${event.channel.name}");
  });

  bot.register((BotPartEvent event) {
    print("Left ${event.channel.name}");
  });

  bot.register((MessageEvent event) => print("<${event.target}><${event.from}> ${event.message}"));

  bot.connect();
}
6
likes
0
points
128
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