Depending on the platform, there are built-in tools and features that help mitigate some degree of spam. If you have a large, open community you'll never be able to get rid of or prevent all of it, but you can build additional safeguards against it and provide tools for your members to quickly and easily report it to you so you can take action against it. Even in smaller, private community spaces you still run the risk of individuals DMing folks to sell things or over promoting in public channels, but that's easier to handle by having solid rules and escalation policies in place.
For further actions, you may consider blocking this person and/or reporting abuse
Depending on the platform, there are built-in tools and features that help mitigate some degree of spam. If you have a large, open community you'll never be able to get rid of or prevent all of it, but you can build additional safeguards against it and provide tools for your members to quickly and easily report it to you so you can take action against it. Even in smaller, private community spaces you still run the risk of individuals DMing folks to sell things or over promoting in public channels, but that's easier to handle by having solid rules and escalation policies in place.