How to block senders in Messages app on Mac OS X? How to mark as spam? Getting many junk texts during election season. 

Messages come to both my iPhone and MacBook Pro (connected via my iCloud account). 

I'm not seeing any way to mark messages as spam, nor to block senders. 

Opening app prefs, and trying to copy–paste the number into the blocked list isn't taking either. 

Able to set conversation as do-not-disturb. This disables notifications, but isn't really all I want.
I'll leave the iOS version below,. as that actually works - but for OS X it's nowhere near as efficient.

Messages > Prefs > Accounts > Blocked
Click +
You can type the phone number but nothing will happen unless the number is already recognised as a Contact [which is frankly infuriating].

One workaround might be to make a Contact called "zzz spam" &amp; keep adding bad actors to that contact, which may also immediately add them to the banlist anyway.

tbh, I'd prefer a better answer than this, if anybody has one

[Previous answer, mistakenly for iOS]
From Apple KB : Block phone numbers and contacts or filter messages on your iPhone, iPad or iPod Touch


  Messages
  
  If you're in Messages, open the conversation, tap ,
  then tap the name or phone number. Scroll to the bottom of the Info
  screen, then tap Block this Caller.