コード例 #1
0
ファイル: TwitchIrcClient.cs プロジェクト: Jaika1/MizuiroBot
 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];
 }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
ファイル: TwitchChannel.cs プロジェクト: Jaika1/MizuiroBot
 public TwitchChannel(string chan, TwitchIrcClient c)
 {
     client  = c;
     Channel = chan;
 }