The User Settings is located near the lower right of your Discord screen denoted by the gear icon. Go to the “Who Can Add You As A Friend” section and turn off everything if you want complete privacy over your profile. This should stop random profiles and spam bots from messaging you and adding you as a friend.