Ejemplo n.º 1
0
 /// <summary>
 /// Updates the filter for the of friends.
 /// </summary>
 public void RelationUpdate()
 {
     relationshipManager.Filter((ref Relationship relationship) =>
     {
         return(relationship.Type == Discord.RelationshipType.Friend && (onlyOnline? relationship.Presence.Status == Status.Online:true));
     });
 }
Ejemplo n.º 2
0
        public void BuildFriendsList()
        {
            CleanupFriendsList();
            manager.Filter(((ref Relationship relationship) => relationship.Type == RelationshipType.Friend));

            for (uint i = 0; i < manager.Count(); i++)
            {
                var rlxn = manager.GetAt(i);
                UpdateFriend(ref rlxn);
            }
        }
        private void OnRefresh()
        {
            manager.Filter((ref Relationship relationship) => relationship.Type == RelationshipType.Friend);

            // Loop over all friends a user has.
            Debug.LogFormat("relationships updated: {0}", manager.Count());

            for (var i = 0; i < manager.Count(); i++)
            {
                // Get an individual relationship from the list
                var r = manager.GetAt((uint)i);
                Debug.LogFormat("relationships: {0} {1}", r.Type, r.User.Username);
                // Save r off to a list of user's relationships
            }
        }