internal static TwitchChatEvent Parse(ITwitchFactory factory, string chatEventCommand) { string command; // TODO, support Mod events -- e.g. :jtv MODE #hardlysober +o arbedii if(chatEventCommand.StartsWith("PING")) { command = "PING"; } else { command = chatEventCommand.GetBetween(" ", " "); } if(command.Equals("PRIVMSG")) { TwitchChannel channel = ParseChannel(factory, chatEventCommand); TwitchUser user = ParseUser(factory, chatEventCommand); string message = chatEventCommand.GetAfter("#" + channel.user.userName + " :"); return new TwitchChatMessage(channel, user, message); } else if(command.Equals("WHISPER")) { TwitchUser user = ParseUser(factory, chatEventCommand); string message = chatEventCommand.GetAfter(" :"); return new TwitchChatWhisper(user, message); } else if(command.Equals("PING")) { return new TwitchChatPing(); } else { return new TwitchChatUnknownEvent(chatEventCommand); } }
public TwitchIrcConnection(ITwitchFactory factory, TwitchBot bot, bool whisperServer) { this.factory = factory; this.bot = bot; this.whisperServer = whisperServer; Reconnect(); }
public TwitchChatRoom(ITwitchFactory factory, TwitchIrcConnection chatConnection, TwitchIrcConnection whisperConnection, TwitchConnection twitchConnection) { this.factory = factory; this.chatIrcConnection = chatConnection; this.whisperIrcConnection = whisperConnection; this.twitchConnection = twitchConnection; this.pointManager = new ChannelPointManager(factory, twitchConnection.channel); chatConnection.Join(this); TypeHelpers.InstantiateEachSubclass<IAutoJoinTwitchRooms, TwitchChatRoom>(this); }
public TwitchChatRoom(ITwitchFactory factory, TwitchIrcConnection chatConnection, TwitchIrcConnection whisperConnection, TwitchConnection twitchConnection) { this.factory = factory; this.chatIrcConnection = chatConnection; this.whisperIrcConnection = whisperConnection; this.twitchConnection = twitchConnection; this.pointManager = new ChannelPointManager(factory, twitchConnection.channel); chatConnection.Join(this); TypeHelpers.InstantiateEachSubclass <IAutoJoinTwitchRooms, TwitchChatRoom>(this); }
internal static TwitchChatEvent Parse(ITwitchFactory factory, string chatEventCommand) { string command; // TODO, support Mod events -- e.g. :jtv MODE #hardlysober +o arbedii if (chatEventCommand.StartsWith("PING")) { command = "PING"; } else { command = chatEventCommand.GetBetween(" ", " "); } if (command.Equals("PRIVMSG")) { TwitchChannel channel = ParseChannel(factory, chatEventCommand); TwitchUser user = ParseUser(factory, chatEventCommand); string message = chatEventCommand.GetAfter("#" + channel.user.userName + " :"); return(new TwitchChatMessage(channel, user, message)); } else if (command.Equals("WHISPER")) { TwitchUser user = ParseUser(factory, chatEventCommand); string message = chatEventCommand.GetAfter(" :"); return(new TwitchChatWhisper(user, message)); } else if (command.Equals("PING")) { return(new TwitchChatPing()); } else { return(new TwitchChatUnknownEvent(chatEventCommand)); } }
public TwitchApi(ITwitchFactory factory) { this.factory = factory; twitchJson = new TwitchJson(factory); }
public ChannelPointManager(ITwitchFactory factory, TwitchChannel channel) { this.factory = factory; this.channel = channel; units = LoadUnits(channel); }
private static TwitchChannel ParseChannel(ITwitchFactory factory, string chatEventCommand) { return(factory.GetChannel(factory.GetUserFromName(chatEventCommand.GetBetween(" #", " ")))); }
private static TwitchUser ParseUser(ITwitchFactory factory, string chatEventCommand) { return(factory.GetUserFromName(chatEventCommand.GetBetween(":", "!"))); }
public TwitchUserPointManager(ITwitchFactory factory, TwitchChannel channel, TwitchUser user) { sqlPoints = factory.GetUserPoints(user, channel); }
public TwitchChatBot(ITwitchFactory factory) { this.factory = factory; }
public TwitchJson(ITwitchFactory factory) { this.factory = factory; }
private static TwitchChannel ParseChannel(ITwitchFactory factory, string chatEventCommand) { return factory.GetChannel(factory.GetUserFromName(chatEventCommand.GetBetween(" #", " "))); }
private static TwitchUser ParseUser(ITwitchFactory factory, string chatEventCommand) { return factory.GetUserFromName(chatEventCommand.GetBetween(":", "!")); }
public Twitch(ITwitchFactory factory) { this.factory = factory; twitchApi = new TwitchApi(factory); }