public static int Connect(TwitchIRCConnection connection, bool extendedInformation) { if (connection.ConnectionStatus == 0) { int isConnected = connection.Connect(); if (isConnected == 0) { connection.Send("PASS oauth:" + connection.UserPassword); connection.Send("NICK " + connection.Username); if (extendedInformation) { connection.Send("CAP REQ :twitch.tv/membership"); connection.Send("CAP REQ :twitch.tv/commands"); connection.Send("CAP REQ :twitch.tv/tags"); } } else { return(1); } } return(0); }
public static int Disconnect(TwitchIRCConnection connection) { if (connection.ConnectionStatus == 1) { connection.Disconnect(); } return(0); }
public static String ReadMessage(TwitchIRCConnection connection) { String message = ""; message = connection.Receive(); if (message.ToLower().StartsWith("ping")) { TwitchIRCClient.SendServerMessage("PONG :tmi.twitch.tv", connection); } return(message); }
public static int Restart(TwitchIRCConnection connection, bool extendedInformation) { if (connection.ConnectionStatus == 0 || connection.ConnectionStatus == 2) { TwitchIRCClient.Connect(connection, extendedInformation); } if (connection.ConnectionStatus == 1) { TwitchIRCClient.Disconnect(connection); TwitchIRCClient.Connect(connection, extendedInformation); } return(0); }
public static int DepartChannel(String channelName, TwitchIRCConnection connection) { return(TwitchIRCClient.SendServerMessage("PART #" + channelName, connection)); }
public static int JoinChannel(String channelName, TwitchIRCConnection connection) { return(TwitchIRCClient.SendServerMessage("JOIN #" + channelName, connection)); }
public static int SendWisperMessage(String username, String message, TwitchIRCConnection connection) { return(TwitchIRCClient.SendServerMessage(".w " + username + " " + message, connection)); }
public static int SendChannelMessage(String channelName, String message, TwitchIRCConnection connection) { return(TwitchIRCClient.SendServerMessage("PRIVMSG #" + channelName + " :" + message, connection)); }
public static int SendServerMessage(String message, TwitchIRCConnection connection) { return(connection.Send(message)); }
public void SetConnectionInformation(string username, string userPassword, bool extendedInformation, string serverAddress, int serverPort) { Connection = new TwitchIRCConnection(username, userPassword, serverAddress, serverPort); ExtendedInformation = extendedInformation; }
public void SetConnectionInformation(string username, string userPassword, bool extendedInformation, bool useSSL) { Connection = new TwitchIRCConnection(username, userPassword, useSSL); ExtendedInformation = extendedInformation; }