コード例 #1
0
        private IEnumerable <string> GetGroups(string nick)
        {
            var temp = new List <string>();

            foreach (var group in groups.Keys)
            {
                if (groups[group].Contains(nick))
                {
                    temp.Add(group);
                }
            }

            foreach (string channel in bot.MainBotData.Channels.Select(c => c.ChannelName))
            {
                var user = (NonRfcChannelUser)bot.GetChannelUser(channel, nick);
                if (user == null)
                {
                    continue;
                }
                if (user.IsVoice)
                {
                    temp.Add("#+" + channel);
                }
                if (bot.SupportNonRfc && user.IsHalfop)
                {
                    temp.Add("#%" + channel);
                    temp.Add("#+" + channel);
                }
                if (user.IsOp)
                {
                    temp.Add("#@" + channel);
                    if (bot.SupportNonRfc)
                    {
                        temp.Add("#%" + channel);
                    }
                    temp.Add("#+" + channel);
                }
                temp.Add("#*" + channel);
                temp.Add("#*");
            }
            return(temp);
        }