Our perception of their friendship might not always be up to par, but they'll continue doing their friendly activities whether we realize those activities are friendly or not. Guilt is the energy for personal change. Unworthiness keeps us on track. Hurt feelings remind us how much we care. Anger is the energy for change.
Discouragement reveals our courage.
Observe your personal process of discouragement. Since nothing we intend is ever faultless, and nothing we attempt ever without error, and nothing we achieve without some measure of finitude and fallibility we call humanness, we are saved by forgiveness. Forgive yourself for treating your friends as enemies. Forgive yourself for all the things you could have done if only you had learned this years ago. Forgive yourself in general.