SharpTox.Core.Tox.AddFriend C# (CSharp) Method

AddFriend() public method

Adds a friend to the friend list and sends a friend request.
public AddFriend ( ToxId id, string message ) : int
id ToxId The Tox id of the friend to add.
message string The message that will be sent along with the friend request.
return int
        public int AddFriend(ToxId id, string message)
        {
            var error = ToxErrorFriendAdd.Ok;
            return AddFriend(id, message, out error);
        }

Same methods

Tox::AddFriend ( ToxId id, string message, ToxErrorFriendAdd &error ) : int

Usage Example

Example #1
0
        public void Init()
        {
            var options = new ToxOptions(true, true);
            _tox1 = new Tox(options);
            _tox2 = new Tox(options);

            _tox1.AddFriend(_tox2.Id, "hey");
            _tox2.AddFriend(_tox1.Id, "hey");

            while (_tox1.GetFriendConnectionStatus(0) == ToxConnectionStatus.None)
            {
                DoIterate();
            }
        }
All Usage Examples Of SharpTox.Core.Tox::AddFriend