public ChatMessageReceivedEventArgs(TwitchIrcClient client, string prefix, string param) { IrcUser = prefix; User = prefix.Remove(prefix.IndexOf('!')); string[] paramSplit = param.Split(" :"); Channel = client.GetChannel(paramSplit[0].Replace("#", null)); Content = paramSplit[1]; }
public TwitchClient() { client = new TwitchIrcClient(); client.ChatMessageReceived += ChatMessageReceived; client.ChannelJoined += Client_ChannelJoined; client.Connected += Client_Connected; Assembly asm = Assembly.GetEntryAssembly(); IEnumerable <Type> commandModules = from t in asm.GetTypes() where t.GetTypeInfo().BaseType == typeof(TwitchCommandModule) select t; IEnumerable <MethodInfo> commandMethods = from t in commandModules from m in t.GetMethods() where m.GetCustomAttributes <TwitchCommand>().Count() == 1 select m; foreach (MethodInfo mi in commandMethods) { TwitchCommand commandInfo = mi.GetCustomAttribute <TwitchCommand>(); commandList.Add(commandInfo.CommandName, mi); } }
public TwitchChannel(string chan, TwitchIrcClient c) { client = c; Channel = chan; }