robotty/dank-twitch-irc

View on GitHub
lib/functionalities/reply-to-ping.ts

Summary

Maintainability
A
0 mins
Test Coverage
F
40%
import { SingleConnection } from "../client/connection";

export function replyToServerPing(conn: SingleConnection): void {
  conn.on("PING", (msg) => {
    if (msg.argument == null) {
      conn.sendRaw("PONG");
    } else {
      conn.sendRaw(`PONG :${msg.argument}`);
    }
  });
}