func onFriendRequest(t *golibtox.Tox, publicKey []byte, data []byte, length uint16) { name, _ := t.GetSelfName() fmt.Printf("[%s] New friend request from %s\n", name, hex.EncodeToString(publicKey)) // Auto-accept friend request t.AddFriendNorequest(publicKey) }
func onFriendRequest(t *golibtox.Tox, publicKey []byte, data []byte, length uint16) { fmt.Printf("New friend request from %s\n", hex.EncodeToString(publicKey)) fmt.Printf("With message: %v\n", string(data)) // Auto-accept friend request t.AddFriendNorequest(publicKey) }