A symmetry result in $${\mathbb {R}}^2$$ for global minimizers of a general type of nonlocal energy