tmi 0.0.4
tmi: ^0.0.4 copied to clipboard

Dart library for the Twitch Messaging Interface. (Twitch.tv)

example/main.dart

import 'package:tmi/tmi.dart' as tmi;

void main() {
  var client = tmi.Client(
    channels: "androidedelvalle",
    secure: true,
  );
  client.connect();

  client.on("message", (channel, userstate, message, self) {
    print("${channel}| ${userstate['display-name']}: ${message}");
  });
  client.on("join", (channel, username, self) {
    if (!self) {
      print("${channel}> ${username} join");
    }
  });
  client.on("raided", (channel, username, viewers, userstate) {
    print("${channel}> === RAID === ${viewers} from ${username}");
  });
  client.on("resub",
      (channel, username, streakMonths, msg, userstate, methods) {
    print("${channel}> CAPO $username por sus $streakMonths!: $msg");
  });
  client.on("subscription", (channel, username, methods, msg, userstate) {
    print("${channel}>>>> NEW SUB: $username");
  });
  client.on("roomstate", (channel, tags) {
    print("${channel} JOINING $tags");
  });
  client.on("pong", (latency) {
    print("pong delayed by $latency");
  });
  client.on("notice", (channel, msgid, message) {
    print("~~~~ $msgid ----> $message");
  });
}
4
likes
80
pub points
32%
popularity

Dart library for the Twitch Messaging Interface. (Twitch.tv)

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

eventify, logger, websok

More

Packages that depend on tmi