How do I programmatically set a user as spam in BuddyPress?

I am working on a moderation tool. One of the actions I want my moderators to be able to achieve is setting a user account as spam. I know how to do so via the UI as admin but how do I do the same via code?

Topic php plugin-development spam buddypress Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.