예제 #1
0
        public async Task <IGroup> GetGroup(string groupid, PalBot bot)
        {
            if (_groups.ContainsKey(groupid))
            {
                return(_groups[groupid]);
            }

            var group = (OutGroup)await bot.WritePacket <Group>(packetTemplate.GroupProfile(groupid));

            _groups.Add(groupid, group);
            return(group);
        }
예제 #2
0
        public async Task <IUser> GetUser(string userid, PalBot bot)
        {
            if (_users.ContainsKey(userid))
            {
                return(_users[userid]);
            }

            var user = (OutUser)await bot.WritePacket <User>(packetTemplate.UserProfile(userid));

            _users.Add(userid, user);
            return(user);
        }