Many content systems supporting freeform entry of HTML strip out
I am not familiar with BBCode macros but have written similar shortcode handlers for WordPress.
You may have special markup such as
[tweet id="792752854192775168"]. Your macro processing code would extract the Tweet ID from the id attribute, provide some basic validation, and request markup from Twitter’s oEmbed-compatible API. You might choose to omit the returned
Once you have the fallback markup you’ll ideally cache it so you’re not making a server-to-server request to Twitter’s oEmbed API with every page load.
If you’d like to get advanced you would recognize the possible
<blockquote class="twitter-tweet"> markup that could be posted into an editing area, extract the Tweet ID within, and store as a BBCode macro. Liberal in what you accept, conservative in what you store, etc.
The embedded Tweet CMS best practices guide on our developer site has some more information.